home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_206 / stereodemo / sources / stereo.asm < prev    next >
Assembly Source File  |  1992-05-06  |  64KB  |  2,627 lines

  1.  
  2.  
  3.     INCLUDE    "include:exec/types.i"    ;Needed for SOFFSET macro
  4.     INCLUDE "Stereo.i"
  5.  
  6. *Exec Library functions
  7.     XREF    _intena
  8.     XREF    _AbsExecBase    ;Base address for exec library
  9.     XREF    _LVOWaitPort
  10.     XREF    _LVOGetMsg
  11.     XREF    _LVOPutMsg
  12.     XREF    _LVOReplyMsg
  13.     XREF    _WBenchMsg
  14.     XREF    _LVOOpenLibrary    ;exec function to open library
  15.     XREF    _LVOCloseLibrary
  16.     XREF    _LVOAllocMem
  17.     XREF    _LVOFreeMem
  18.     XREF    _LVODoIO
  19.     XREF    _LVOSendIO
  20.     XREF    _LVOCheckIO
  21.     XREF    _LVOAbortIO
  22.     XREF    _LVORemove
  23.     XREF    _LVOAllocSignal
  24.     XREF    _LVOFreeSignal
  25.     XREF    _LVOFindTask
  26.     XREF    _LVOAddTask
  27.     XREF    _LVORemTask
  28.     XREF    _LVOOpenDevice
  29.     XREF    _LVOCloseDevice
  30.     XREF    _LVOForbid
  31.     XREF    _LVOPermit
  32.     XREF    _LVOOpenDiskFont
  33.     XREF    _LVOCloseFont
  34. *Dos Library functions
  35.     XREF    _LVOExecute
  36.     XREF    _LVOOutput    ;DOS functions
  37.     XREF    _LVODelay
  38.     XREF    _LVOOpen
  39.     XREF    _LVOClose
  40.     XREF    _LVOIoErr
  41.     XREF    _LVOCurrentDir
  42.     XREF    _LVOParentDir
  43.     XREF    _LVOExamine
  44.     XREF    _LVOLock
  45.     XREF    _LVOUnLock
  46.     XREF    _LVORead
  47.     XREF    _LVOWrite
  48.  
  49. *Graphics Library functions
  50.     XREF    _LVOSetDrMd
  51.     XREF    _LVOOwnBlitter
  52.     XREF    _LVODisownBlitter
  53.     XREF    _LVOWaitBlit
  54.     XREF    _LVOAllocRaster
  55.     XREF    _LVOFreeRaster
  56.     XREF    _LVOInitView
  57.     XREF    _LVOInitVPort
  58.     XREF    _LVOInitBitMap
  59.     XREF    _LVOGetColorMap
  60.     XREF    _LVOFreeColorMap
  61.     XREF    _LVOFreeVPortCopLists
  62.     XREF    _LVOFreeCprList
  63.     XREF    _LVOMakeVPort
  64.     XREF    _LVOMrgCop
  65.     XREF    _LVOLoadView
  66.     XREF    _LVOInitRastPort
  67.     XREF    _LVOMove
  68.     XREF    _LVODraw
  69.     XREF    _LVOText
  70.     XREF    _LVOSetAPen
  71.     XREF    _LVOSetFont
  72.     XREF    _LVOWaitBOVP
  73.     XREF    _LVOBltClear
  74.     XREF    _LVOLoadRGB4
  75. *Intuition Library functions
  76.     XREF    _LVOClearScreen
  77.     XREF    _LVOScreenToFront
  78.     XREF    _LVOScreenToBack
  79.     XREF    _LVOOpenWindow
  80.     XREF    _LVOCloseWindow
  81.     XREF    _LVORequest
  82.     XREF    _LVOEndRequest
  83.     XREF    _LVOGetPrefs
  84.     XREF    _LVOMoveScreen
  85.     XREF    _LVOOpenScreen
  86.     XREF    _LVOCloseScreen
  87. *Translator Library Function
  88.     XREF    _LVOTranslate
  89.  
  90.     XDEF    __Animate3D
  91.  
  92. IO_QUICK    EQU    1    ;Bit 0 set for quick io
  93. NT_MESSAGE    EQU    5
  94. gb_ActiView    EQU    $22
  95. *IDNestCnt    EQU    $22
  96. MyGadgets    EQU    WINDOWDRAG!WINDOWDEPTH!WINDOWSIZING    ;!WINDOWCLOSE
  97. MyFeatures    EQU    SMART_REFRESH!ACTIVATE
  98. MyFlags        EQU    MyGadgets!MyFeatures!WINDOWSIZING
  99. MyFlag    EQU    MyGadgets!MyFeatures
  100. MODE_OLDFILE        EQU    1005
  101. MODE_NEWFILE        EQU    1006
  102. MLP1    EQU    33
  103. SIGNFLAG    equ    $40
  104. MyView        EQU    V_LACE!V_HIRES
  105.  
  106. TRUE        EQU    -1
  107. FALSE        EQU    0
  108.  
  109. CLEAR_PUBLIC    EQU    MEMF_CHIP!MEMF_CLEAR
  110. Trig_Size    EQU    900        ;Enough mem for 450 s.w. degrees
  111. LE_Size        EQU    $400        ;$200 words for Left Eye
  112. RE_Size        EQU    $400        ;$200 words for Right Eye
  113. Eye_Size    EQU    LE_Size+RE_Size
  114. OB_Size        EQU    400    ;Output buffer of narrator
  115. TB_Size        EQU    164    ;Two lines of centered text
  116. Public_Size    EQU    nw_SIZE+Trig_Size+Eye_Size+OB_Size+TB_Size    ;+ss_SIZEOF
  117. SOLID        EQU    $FFFF
  118. DOTTED        EQU    $AAAA
  119. SWidth    EQU    640
  120. SHeight    EQU    400
  121. S1Width    EQU    SWidth-1
  122. S1Height    EQU    SHeight-1
  123. BPDepth    EQU    2
  124. CHPADR    EQU    $DFF000
  125. COP1LCH    EQU    $80
  126. COPJMP1    EQU    $88
  127. DMACONW    EQU    $96
  128. SETBIT    EQU    $80
  129. DMACONR    EQU    $2
  130. INTREQR    EQU    $1E
  131.  
  132. DDRA    EQU    $BFE201    ;DDR for CIAA
  133. SDR    EQU    $BFEC01    ;Serial data register of CIAA
  134.  
  135. POT0DAT    EQU    $12
  136. POT1DAT    EQU    $14
  137.  
  138. BLTCON0    EQU    $40        ;Control register 0
  139. BLTCON1    EQU    $42        ;Control register 1
  140. BLTAFWM    EQU    $44        ;Blitter first word mask for source A
  141. BLTALWM    EQU    $46        ;Blitter last word mask for source A
  142.  
  143. BLTCPTH    EQU    $48        ;Blitter pointer C  (high 3 bits)
  144. BLTCPTL    EQU    $4A        ;Blitter pointer C (low 16 bits)
  145.  
  146. BLTBPTH    EQU    $4C        ;Blitter pointer B  (high 3 bits)
  147. BLTBPTL    EQU    $4E        ;Blitter pointer B (low 16 bits)
  148. BLTAPTH    EQU    $50        ;Blitter pointer A  (high 3 bits)
  149. BLTAPTL    EQU    $52        ;Blitter pointer A (low 16 bits)
  150. BLTDPTH    EQU    $54        ;Blitter pointer D  (high 3 bits)
  151. BLTDPTL    EQU    $56        ;Blitter pointer D (low 16 bits)
  152. BLTSIZE    EQU    $58        ;Start & size (window width, height)
  153.  
  154. BLTCMOD    EQU    $60
  155. BLTBMOD    EQU    $62
  156. BLTAMOD    EQU    $64
  157. BLTDMOD    EQU    $66
  158.  
  159. BLTCDAT    EQU    $70
  160. BLTBDAT    EQU    $72
  161. BLTADAT    EQU    $74
  162.  
  163. BPL1PTH    EQU    $E0
  164. BPL1PTL    EQU    $E2
  165.  
  166. BPLCON0    EQU    $100
  167. BPLCON1    EQU    $102
  168. BPLCON2    EQU    $104
  169.  
  170.  
  171. __Animate3D:
  172.     move.l    a7,InitSP    ;Save initial stack pointer
  173.     move.l    a6,Savea6    ;Library pointer=0 for icon, FF44A8 for CLI
  174.     move.l    a5,Savea5
  175.     move.l    #0,xoffset
  176.     move.l    _WBenchMsg,a0
  177.     move.l    a0,WBMsg
  178.     move.l    sm_ArgList(a0),a0    ;Get pointer to arglist
  179.     move.l    wa_Name(a0),d1
  180.     move.l    d1,MyName
  181.     move.l    WBMsg,d0    ;See if from workbench
  182.     bne.s    NoCLI
  183.     bsr    CopyPath
  184. NoCLI:    bsr    OpenDOS
  185.     bsr    LibsOpen    ;Open Dos, Graphics and Intuition Libraries
  186.     bsr    GetFont
  187.     bsr    OpenNew        ;Open the new window
  188. *    bsr    SaveSprite    ;Save data of sprite pointer
  189.     bsr    SpeakPort
  190.     bsr    ConsolePort
  191.     bsr    OpenNil
  192.     bsr    PageTitle
  193.     bsr    OpenNewScreen
  194.     bsr    ColorSet
  195.     bsr    CustomClear
  196. *    bset.b    #0,SprSts    ;Show that pointer is visible
  197. Repeat:
  198. *    bsr    SpriteClear
  199. AmyName:
  200.     move.l    #1,DZ
  201.     bsr    SetMale
  202.     lea    AmigaName,a5
  203.     move.l    #90,Theta
  204.     move.l    #128,DTheta
  205. HexMot:    move.l    #0,d0
  206.     move.l    d0,Phi
  207.     move.l    d0,DPhi
  208.     move.l    d0,xoffset
  209.     move.l    d0,yoffset
  210.     move.l    d0,zoffset
  211.     move.w    d0,FrmCnt
  212. HexWait:
  213.     bsr    TriGet
  214.     bsr    LoadOne
  215.     jsr    (a5)
  216.     bsr    EndChk
  217.     bsr    TriGet
  218.     bsr    LoadTwo
  219.     jsr    (a5)
  220.     cmp.w    #2,FrmCnt
  221.     bne.s    NotFrst
  222.     lea    Mes1,a0
  223.     move.b    #5,d0
  224. SpkThr:    bsr    TransIt
  225.     sub.b    #1,d0
  226.     bne.s    SpkThr
  227.     bsr    SetFemale
  228.     lea    AmyTab,a1
  229.     move.l    (a1)+,a0
  230.     move.l    a1,CurAmy
  231.     bsr    Async
  232. NotFrst:
  233.     bsr    EndChk
  234.     bra.s    HexWait
  235. CheckIt:
  236.     movem.l    a0-a6,-(a7)
  237.     move.l    PendIO,d0
  238.     tst.l    d0
  239.     beq.s    NotPnd
  240.     move.l    _AbsExecBase,a6
  241.     move.l    SpeakIO,a1
  242.     jsr    _LVOCheckIO(a6)
  243.     tst.l    d0        ;See if null returned
  244.     beq.s    NotPnd        ;Actually pending, but not done
  245.     move.l    d0,a1        ;Address of structure for returned message
  246.     jsr    _LVORemove(a6)    ;d0 should have been equal to a1.
  247.     move.l    #0,PendIO    ;Clear pending status
  248.     move.l    CurAmy,a1    ;Get address of pointer to next message
  249.     move.l    (a1)+,d0    ;Get address of next message
  250.     beq.s    NotPnd
  251.     move.l    a1,CurAmy
  252.     move.l    d0,a0
  253.     bsr    ChkSnd        ;Check sound characteristics
  254.     bsr    Async        ;Start next message
  255. NotPnd:    movem.l    (a7)+,a0-a6
  256.     rts
  257. ChkSnd:    move.l    SpeakIO,a1
  258.     cmp.l    #AmyFour,d0    ;See if Amy upset on next one.
  259.     beq.s    FulVol
  260.     cmp.l    #AmySix,d0
  261.     beq.s    FulVol
  262. VolNrm:    move.w    #40,NDI_VOLUME(a1)
  263.     cmp.l    #DaveThree,d0
  264. *    beq    SetScreen
  265.     beq    SetMale
  266.     cmp.l    #Lst1,d0
  267.     beq    SetMale
  268.     cmp.l    #NxtFive,d0
  269.     beq    SetFemale
  270.     cmp.l    #NxtEgt,d0
  271.     beq    SetMale
  272.     cmp.l    #NxtTen,d0
  273.     beq    SetFemale
  274.     cmp.l    #NxtTwl,d0
  275.     beq    SetMale
  276.     cmp.l    #NxtFrt,d0
  277.     beq    SetMale
  278.     cmp.l    #NxtSxt,d0
  279.     beq    SetFemale
  280.     cmp.l    #NxtNnt,d0
  281.     beq    SetMale
  282.     cmp.l    #NxtTwt,d0    ;See if we want to move screen up
  283.     beq.s    SetScreen
  284.     cmp.l    #NxtThr,d0
  285.     bne.s    NotSlo
  286.     move.w    #80,NDI_RATE(a1)
  287. NotSlo:    rts
  288. FulVol:    move.w    #64,NDI_VOLUME(a1)
  289.     bsr    SetFemale    ;Only Amy talks loud
  290.     rts
  291. SetScreen:
  292.     movem.l    d0-d7/a0-a6,-(a7)
  293.     bsr    SetMale
  294.     bsr    ScreenUp
  295.     movem.l    (a7)+,d0-d7/a0-a6
  296.     rts
  297. OpenNew:
  298.     move.l    #Public_Size,d0
  299.     bsr    StructureAlloc
  300.     move.l    d0,a2
  301.     move.l    d0,MyNewWindow    ;Store pointer
  302.     beq    Term        ;Terminate program if failed
  303. *    bne.s    SucAll
  304. *    move.l    #3,ErrNum
  305. *    bra    TotalFail    ;Can't display if not to this point.
  306. *SucAll:    move.l    a2,MyNewWindow
  307.     bsr.s    PointStruct    ;Set up pointers for different structures.
  308.     bsr.s    InitNewWindow    ;Initialize new window structure
  309.     move.l    MyNewWindow,a0
  310.     movea.l    IntuitionLibrary,a6    ;a6 established by IntuOpen
  311.     jsr    _LVOOpenWindow(a6)  ;Open the new window.
  312.     move.l    d0,MyWindow    ;Pointer to window structure for new window
  313.     move.l    d0,a0
  314.     beq    Term        ;Terminate if failed to open window
  315.     move.l    wd_WScreen(a0),a0    ;Get to Work bench screen point
  316.     add.l    #sc_ViewPort,a0        ;Get up to ViewPort structure
  317.     move.l    vp_ColorMap(a0),a2    ;Get pointer to colormap structure
  318.     move.l    cm_ColorTable(a2),a2    ;Get pointer to Color Table
  319.     lea    SColor,a1
  320.     move.l    (a2)+,(a1)+
  321.     move.l    (a2),(a1)        ;Store original color table
  322.     move.l    a0,PortView
  323.     rts
  324. OldColor:
  325.     lea    SColor,a1
  326.     bra.s    ChColr
  327. NewColor:
  328.     lea    MCTable,a1
  329. ChColr:    move.l    a6,-(a7)
  330.     move.l    PortView,a0
  331.     move.l    #4,d0
  332.     move.l    GraphicsLibrary,a6
  333.     jsr    _LVOLoadRGB4(a6)
  334.     move.l    (a7)+,a6
  335.     rts
  336. InitNewWindow:
  337.     bsr    TitleTran
  338.     move.l    MyNewWindow,a2
  339.     move.w    #SWidth,nw_Width(a2)
  340.     move.w    #200,nw_Height(a2)
  341.     move.b    #0,nw_DetailPen(a2)    ;Invisible
  342.     move.b    #1,nw_BlockPen(a2)    ;White
  343.     move.l    #MyFlag,nw_Flags(a2)
  344.     move.l    WTBuf,d1
  345.     move.l    d1,nw_Title(a2)
  346.     move.w    #SWidth,nw_MinWidth(a2)
  347.     move.w    #100,nw_MinHeight(a2)
  348.     move.w    #SWidth,nw_MaxWidth(a2)
  349.     move.w    #200,nw_MaxHeight(a2)
  350.     move.w    #WBENCHSCREEN,nw_Type(a2)
  351.     rts
  352. PointStruct:
  353.     adda.l    #nw_SIZE,a2        ;Get base for Raster a
  354. *    move.l    a2,SpriteBuffer        ;Save pointer to sprite buffer
  355. *    adda.l    #ss_SIZEOF,a2
  356.     move.l    a2,LeftEye
  357.     adda.l    #LE_Size,a2
  358.     move.l    a2,RightEye
  359.     adda.l    #RE_Size,a2
  360.     move.l    a2,OutBuf
  361.     adda.l    #400,a2
  362.     move.l    a2,WTBuf
  363.     adda.l    #82,a2
  364.     move.l    a2,StrBuf
  365.     adda.l    #82,a2
  366.     move.l    a2,SinTab
  367.     adda.l    #180,a2            ;Find cosine base
  368.     move.l    a2,CosTab
  369.     lea    sintab,a0        ;Locate sine table in file
  370.     move.l    SinTab,a1        ;Destination of larger table in RAM
  371.     move.l    #91,d0
  372. MovSin:    move.w    (a0)+,(a1)+
  373.     subq.l    #1,d0
  374.     bne.s    MovSin
  375.     rts
  376. StructureAlloc:
  377.     move.l    a6,-(a7)    ;Save a6 (intution library base)
  378.     move.l    _AbsExecBase,a6    ;Exec functions coming up
  379.     move.l    #CLEAR_PUBLIC,d1    ;Public memory
  380.     jsr    _LVOAllocMem(a6)
  381.     move.l    (a7)+,a6    ;Recover a6
  382.     rts
  383. CloseNew:
  384.     move.l    a6,-(a7)
  385.     move.l    MyWindow,d0
  386.     beq.s    NoWind
  387.     move.l    d0,a0
  388.     movea.l    IntuitionLibrary,a6
  389.     jsr    _LVOCloseWindow(a6)
  390. NoWind:    move.l    _AbsExecBase,a6
  391.     move.l    MyNewWindow,d0
  392.     beq.s    NoWdSt
  393.     move.l    d0,a1
  394.     move.l    #Public_Size,d0
  395.     bsr    StructFree
  396. NoWdSt:    move.l    #0,MyNewWindow
  397.     move.l    (a7)+,a6
  398.     rts
  399. *OpenLib opens the library whose name is pointed to by a1.  The library
  400. *base address is returned in d0.  a6 is destroyed.
  401. OpenLib:
  402.     move.l    #MLP1,d0        ;Version 33 or later
  403.     movea.l    _AbsExecBase,a6
  404.     jsr    _LVOOpenLibrary(a6)    ;Find Library base.
  405.     rts                ;Library base returned in d0
  406. OpenDOS:
  407. *Open the Dos Library
  408.     move.l    #DosName,a1        ;Get Dos Name
  409.     bsr.s    OpenLib
  410.     move.l    d0,DosLibrary        ;Save pointer for it
  411. *    beq    TotalFail    ;Hey it can't even give error messages.
  412.     beq    Term        ;Terminate if failure
  413.     rts
  414. LibsOpen:
  415. *Now open intuition    
  416. IntuOpen:
  417.     move.l    #IntuitionName,a1    ;Request intuition library.
  418.     bsr.s    OpenLib
  419.     move.l    d0,IntuitionLibrary
  420.     beq    Term        ;Terminate if failed
  421. GraphicsOpen:
  422. * Open the graphics library
  423.     move.l    #GraphicsName,a1     ;Request graphics library.
  424.     bsr.s    OpenLib
  425.     move.l    d0,GraphicsLibrary    ;Save pointer
  426.     beq    Term            ;Terminate for failure
  427. GraphOpen:
  428.     move.l    #TranslatorName,a1
  429.     bsr.s    OpenLib
  430.     move.l    d0,TranslatorLibrary
  431.     beq    Term
  432. TransOpen:
  433.     move.l    #DiskFontName,a1
  434.     bsr.s    OpenLib
  435.     move.l    d0,DiskFontLibrary
  436.     beq    Term
  437. DFOpen:    rts
  438. CloseLibs:
  439.     move.l    _AbsExecBase,a6        ;Be certain we have exec library
  440.     move.l    DiskFontLibrary,a1
  441.     bsr    CloseLib
  442.     move.l    TranslatorLibrary,a1
  443.     bsr    CloseLib
  444.     move.l    GraphicsLibrary,a1
  445.     bsr    CloseLib        ;Close graphics library
  446.     move.l    IntuitionLibrary,a1
  447.     bsr    CloseLib        ;Close intuition library
  448.     rts
  449. CloseDOS:
  450.     move.l    DosLibrary,a1
  451. CloseLib:
  452.     move.l    a1,d0
  453.     beq.s    NotOpen
  454.     jsr    _LVOCloseLibrary(a6)
  455. NotOpen:
  456.     rts
  457. EndChk:
  458.     bsr    CheckIt
  459.     bsr    KeyRead
  460.     bne.s    KeyOne        ;0 returned if no new key pressed
  461.     rts
  462. KeyOne:
  463.     cmp.b    #3,d0        ;See if Ctrl C
  464.     beq.s    Term        ;Terminate program if ESC pressed
  465.     bclr    #5,d0        ;Clear lower-case bit
  466.     cmp.b    #$49,d0        ;See if I for Intuition
  467.     bne.s    NoRestore
  468.     bsr    ResView
  469. NoRestore:
  470.     rts            ;Return if not I or Control C
  471. AbortIt:
  472.     move.l    a6,-(a7)
  473.     move.l    _AbsExecBase,a6
  474.     jsr    _LVOAbortIO(a6)
  475.     move.l    (a7)+,a6
  476.     rts
  477. Term:
  478.     bsr    OldColor
  479.     move.l    #CommandD,d1
  480.     bsr    DoIt        ;Assign c: sys:c
  481.     move.l    #CommandE,d1
  482.     bsr    DoIt        ;Delete ram:c files
  483.     move.l    SpeakIO,a1
  484.     bsr    AbortIt
  485.     move.l    ConIO,a1
  486.     bsr    AbortIt
  487. TermIt:    move.l    #EndCmd,d1    ;Now erase files from ram
  488.     bsr    DoIt
  489. *    bsr    RestoreSprite
  490.     bsr    CloseNewScreen
  491.     bsr    CloseNil
  492.     bsr    CloseDevices
  493.     bsr    CloseNew    ;Close new Window
  494.     bsr    CloseLibs
  495.     bsr    CloseDOS
  496.     move.l    Savea5,a5
  497.     move.l    Savea6,a6
  498.     move.l    InitSP,a7
  499.     rts
  500. CorkScrew:
  501.     bsr    SetFemale
  502.     lea    Spiral,a5
  503.     bsr    LobInp
  504.     move.w    #0,FrmCnt
  505.     move.l    SegLength,d0
  506.     move.l    #0,Theta
  507.     move.l    #40,ThetaNew
  508.     move.l    #30,Phi
  509.     move.l    #0,yoffset
  510.     move.l    #0,xoffset
  511.     move.l    #-20000,zoffset
  512.     move.l    #10,DZ
  513.     move.l    #2,DTheta
  514.     move.l    #3,DPhi
  515. Frames:
  516.     bsr    TriChg
  517.     bsr    LoadOne
  518.     jsr    (a5)
  519.     bsr    EndChk
  520.     bsr    TriChg
  521.     bsr    LoadTwo
  522.     jsr    (a5)
  523.     bsr    EndChk
  524.     cmp.w    #100,FrmCnt
  525.     bge.s    Frames
  526.     tst.l    DZ        ;See if on return trip
  527.     bmi.s    Frames
  528.     lea    LstTab,a1
  529.     move.l    (a1)+,a0
  530.     move.l    a1,CurAmy
  531.     bsr    Async
  532.     move.w    #100,FrmCnt
  533.     bra.s    Frames
  534.  
  535. * Vector has inputs of d0 = x1, d1 = y1, d2 = z1, d3 = x2,
  536. * d4 = y2 and d5 = z2.  It returns with the first point still in d0 - d2.
  537. Vector:    movem.l    d0-d2,-(a7)
  538.     movem.l    d3-d5,-(a7)
  539.     move.l    d0,xtemp
  540.     move.l    d1,ytemp
  541.     move.l    d2,z
  542.     bsr    Plot3D
  543.     movem.l    (a7)+,d0-d2
  544.     move.l    d0,xtemp
  545.     move.l    d1,ytemp
  546.     move.l    d2,z
  547.     bsr    Plot3D
  548.     bsr    One3D
  549.     movem.l    (a7)+,d0-d2
  550.     rts
  551. * PolyVector adds another 3d line segment.  d0-d2 are the next coordinates.
  552. PolyVector:
  553.     move.l    d0,xtemp
  554.     move.l    d1,ytemp
  555.     move.l    d2,z
  556.     bra    Plot3D
  557. SetUp:
  558.     move.w    #SOLID,TXTURE
  559.     move.w    #0,PointCount        ;Initialize counter.
  560.     move.l    #SWidth,d0
  561.     lsr.l    #3,d0
  562.     move.w    d0,bytwidth
  563.     bsr    TabCom
  564.     rts
  565. LobInp:    
  566.     move.l    #7,d2
  567.     move.l    d2,SegLength
  568.     move.l    #2,DTheta
  569.     rts
  570. TriChg:    move.l    DTheta,d0
  571.     add.l    d0,Theta
  572.     cmp.l    #360,Theta
  573.     blt.s    KepTheta
  574.     sub.l    #360,Theta
  575. KepTheta:
  576.     move.l    DPhi,d0
  577.     add.l    d0,Phi
  578.     cmp.l    #360,Phi
  579.     blt.s    KepPhi
  580.     sub.l    #360,Phi
  581. KepPhi:    cmp.l    #470,zoffset    ;See if already forward
  582.     bge.s    RevPas
  583.     move.l    DZ,d0        ;Get Delta Z
  584.     bmi.s    RevPas
  585.     move.l    zoffset,d0
  586.     bpl.s    ZPlus
  587.     neg.l    d0
  588.     asr.l    #5,d0
  589.     cmp.l    #10,d0
  590.     bgt.s    DZOK
  591. ZPlus:    move.l    #10,d0
  592. DZOK:    add.l    d0,zoffset
  593.     bra.s    TriFnc
  594. RevPas:    move.l    #-1,DZ
  595.     subq.w    #1,FrmCnt
  596.     move.l    zoffset,d0
  597.     bpl.s    PlusZ
  598.     cmp.l    #-30000,d0
  599.     bgt.s    CloseIs
  600. EndLoop:
  601.     adda.l    #4,a7
  602.     move.w    LoopCnt,d0
  603.     bne    Term
  604.     bra    AmyName
  605. CloseIs:
  606.     asr.l    #4,d0
  607.     cmp.l    #-16,d0
  608.     blt.s    KeepDZ
  609.     move.l    #-16,d0
  610. KeepDZ:    add.l    d0,zoffset
  611.     bra.s    TriFnc
  612. PlusZ:    subq.l    #8,zoffset
  613.     bra.s    TriFnc
  614. TriGet
  615.     bsr    ChangeTheta
  616. TriFnc:    lea    Theta,a0
  617.     move.l    (a0),d0
  618.     lsl.l    #1,d0        ;Offset to address of cosine(theta)
  619.     move.l    CosTab,a0
  620.     adda    d0,a0        ;Get address of cosine theta
  621.     move.w    (a0),d1        ;Get value of cosine(theta)
  622.     ext.l    d1        ;Make long
  623.     asr.l    #4,d1
  624.     move.w    d1,CosTheta
  625.     move.l    SinTab,a0
  626.     adda    d0,a0        ;Find sin(theta)
  627.     move.w    (a0),d1        ;Get sin(theta)
  628.     ext.l    d1
  629.     asr.l    #4,d1
  630.     move.w    d1,SinTheta
  631.     lea    Phi,a0
  632.     move.l    (a0),d0
  633.     lsl.l    #1,d0        ;Offset to address of cosine(theta)
  634.     move.l    CosTab,a0
  635.     adda    d0,a0        ;Get address of cosine theta
  636.     move.w    (a0),d1        ;Get value of cosine(theta)
  637.     ext.l    d1        ;Make long
  638.     asr.l    #4,d1
  639.     move.w    d1,CosPhi
  640.     move.l    SinTab,a0
  641.     adda    d0,a0        ;Find sin(theta)
  642.     move.w    (a0),d1        ;Get sin(theta)
  643.     ext.l    d1
  644.     asr.l    #4,d1
  645.     move.w    d1,SinPhi
  646.     rts
  647. GetFont:
  648.     move.l    a6,-(a7)
  649.     move.l    IntuitionLibrary,a6
  650.     lea    PrefBuf,a0
  651.     move.l    #4,d0
  652.     jsr    _LVOGetPrefs(a6)
  653.     move.b    PrefBuf,d0
  654.     cmp.b    #8,d0        ;See if 80 column mode
  655.     beq.s    Eighty
  656.     move.l    #60,PrefBuf
  657.     bra.s    Sixty
  658. Eighty:    move.l    #80,PrefBuf
  659. Sixty    move.l    (a7)+,a6
  660.     rts
  661. CustomClear:
  662.     move.l    #0,TopOffset
  663.     move.w    #0,BottomOffset
  664.     bsr    ClearOne
  665.     bsr    ClearTwo
  666.     move.l    GraphicsLibrary,a6
  667.     move.l    MyScreenA,a1
  668.     move.b    #$FD,d3        ;For raster port mask
  669.     lea    TitleL,a0
  670.     bsr.s    ScTitle
  671.     move.l    MyScreenB,a1
  672.     lea    TitleL,a0
  673.     bsr.s    ScTitle
  674.     move.b    #$FE,d3
  675.     move.l    MyScreenB,a1
  676.     lea    TitleR,a0
  677.     bsr.s    ScTitle
  678.     move.l    MyScreenA,a1
  679.     lea    TitleR,a0
  680.     bsr    ScTitle
  681.     move.l    #3600,TopOffset
  682.     move.w    #45,BottomOffset    ;Clear all but top 45 lines
  683.     rts
  684. ScTitle:
  685.     add.l    #sc_RastPort,a1
  686.     move.b    d3,rp_Mask(a1)
  687.     move.l    a0,-(a7)
  688.     move.l    #2,d0
  689.     move.l    a1,-(a7)
  690.     jsr    _LVOSetDrMd(a6)        ;Set to jam 2 so they don't erase
  691.     move.l    (a7)+,a1        ;each other
  692.     move.l    ScrFnt,a0
  693.     jsr    _LVOSetFont(a6)        ;Set font and setapen don't destroy
  694.     move.l    #3,d0            ;a1
  695.     jsr    _LVOSetAPen(a6)    
  696.     move.l    #200,d0
  697.     move.l    #14,d1
  698.     move.l    (a7)+,a0
  699.     move.l    a1,-(a7)
  700.     jsr    _LVOMove(a6)
  701.     move.l    a0,a1
  702.     bsr    EndFnd
  703.     move.l    (a7)+,a1
  704.     jsr    _LVOText(a6)
  705.     rts
  706. LoadOne:
  707.     move.l    MyScreenB,a1        ;B is current forward screen
  708.     move.l    MyScreenA,a0        ;A is in rear
  709.     bsr.s    ScrAdj
  710.     bra.s    ClearTwo
  711. LoadTwo:
  712.     move.l    MyScreenA,a1        ;Screen A is forward
  713.     move.l    MyScreenB,a0
  714.     bsr    ScrAdj            ;Adjust B to agree with A
  715.     bra    ClearOne
  716. ScreenUp:
  717.     move.w    #175,d1
  718. UpMore:    move.l    d1,-(a7)
  719.     bsr.s    ScreensMove
  720.     move.l    (a7)+,d1
  721.     sub.w    #5,d1
  722.     bge.s    UpMore
  723.     rts
  724. ScreenDown:
  725.     move.w    #5,d1
  726. DnMore:    move.l    d1,-(a7)
  727.     bsr.s    ScreensMove
  728.     move.l    (a7)+,d1
  729.     add.w    #5,d1
  730.     cmp.w    #180,d1
  731.     ble.s    DnMore
  732.     rts
  733. ScreensMove:
  734.     movem.l    d0-d1/a0/a6,-(a7)
  735.     move.l    IntuitionLibrary,a6
  736.     move.l    MyScreenA,a0
  737.     move.w    d1,-(a7)
  738.     bsr.s    ScrnMove
  739.     move.w    (a7)+,d1
  740.     move.w    d1,-(a7)
  741.     move.l    MyScreenB,a0
  742.     bsr.s    ScrnMove
  743.     move.w    (a7)+,d1
  744.     move.w    d1,LastTop
  745.     movem.l    (a7)+,d0-d1/a0/a6
  746.     rts
  747. ScrnMove:
  748.     move.w    sc_TopEdge(a0),d0
  749.     sub.w    d0,d1
  750.     ext.l    d1
  751.     move.l    #0,d0
  752.     jsr    _LVOMoveScreen(a6)
  753.     rts
  754. ScrAdj:    movem.l    a0-a1/a6,-(a7)
  755.     move.l    IntuitionLibrary,a6
  756. *    move.l    sc_MouseY(a1),d0    ;Get current mouse coordinates
  757. *    cmp.l    LastMouse,d0
  758. *    beq.s    NoMouse
  759. *    move.l    d0,LastMouse
  760. *    bsr    RestoreSprite
  761. *    bra.s    KeepSprite
  762. *NoMouse:
  763. *    addq.w    #1,MouCnt        ;Increment frame count for mouse
  764. *    cmp.w    #30,MouCnt        ;See if it's exceeded 30
  765. *    blt.s    KeepSprite
  766. *    bsr    SpriteClear
  767. *KeepSprite:
  768.     move.w    sc_TopEdge(a1),d0    ;Get current top for forward screen
  769.     move.w    d0,d1            ;Save it in d1
  770.     sub.w    LastTop,d0        ;Find change
  771.     beq.s    NoSMov            ;No screen movement
  772.     move.w    d1,LastTop        ;Save new top
  773.     move.w    d0,d1            ;Change into d1
  774.     ext.l    d1
  775.     move.l    #0,d0
  776.     move.l    a0,-(a7)
  777.     jsr    _LVOMoveScreen(a6)    ;Move new screen to agree with other
  778.     move.l    (a7)+,a0
  779. NoSMov:    jsr    _LVOScreenToFront(a6)    ;Move new screen to front
  780.     movem.l    (a7)+,a0-a1/a6
  781.     rts
  782.  
  783. Plot3D:    move.l    z,d0
  784.     move.b    #10,d3        ;For shifting 10 bits.
  785.     move.l    d0,d5        ;z is also in d5
  786.     muls    SinTheta,d5    ;d0 is z*sin(theta)
  787.     lea    xtemp,a0
  788.     move.l    (a0),d1        ;d1 is xtemp
  789.     move.l    d1,d2        ;xtemp is also in d2
  790.     muls    CosTheta,d2    ;d2 is xtemp*cos(theta)
  791.     add.l    d2,d5        ;have found xpr
  792.     muls    CosTheta,d0    ;d0 is z*cos(theta)
  793.     muls    SinTheta,d1    ;d1 is xtemp*sin(theta)
  794.     sub.l    d0,d1        ;d1 is now zint
  795.     asr.l    d3,d5        ;xpr/1024
  796.     move.l    d5,d0        ;Get xpr back into d0
  797.     muls    SinPhi,d0    ;Find ypr=xpr*sin(phi)
  798.     lea    ytemp,a0
  799.     move.l    (a0),d4        ;Get ytemp
  800.     muls    CosPhi,d4    ;ytemp*cos(phi)
  801.     add.l    #50,d4        ;50+ytemp*cos(phi)
  802.     add.l    d4,d0        ;x = y'+ytemp*cos(phi) in d0
  803.     move.w    CosPhi,d2
  804.     muls    d5,d2        ;Find x'*cos(phi)
  805.     move.l    (a0),d4        ;Get ytemp again.
  806.     muls    SinPhi,d4    ;Find ytemp*sin(phi)
  807.     sub.l    d4,d2        ;Find z = x'' for Point3D
  808.     asr.l    d3,d0        ;Shift x down 10 bits
  809.     add.w    #320,d0
  810.     asr.l    d3,d1        ;Shift y down 10 bits
  811.     add.w    #199,d1        ;Add in offset for y-direction
  812.     asr.l    d3,d2        ;Shift z down 10 bits to compensate for
  813.                 ; integer trig functions.
  814.     add.l    xoffset,d0
  815.     add.l    yoffset,d1
  816.     add.l    zoffset,d2
  817.     neg.l    d2        ;Reverse z(actually x)
  818.     bra    Point3D
  819.  
  820. * Set3D works exactly as Point3D, except that it places the points directly
  821. * onto the appropriate bit plane, rather than into a buffer area.
  822. * Inputs include d0(x), d1(y), d2(z) and a3(pointer to address of bit plane)
  823. * No values will be destroyed by routine.
  824. Set3D:    movem.l    d0-d7/a0-a2,-(a7)    ;Save the registers
  825.     move.w    #1024,d4    ;d4 will act as z + z0.
  826.     add.w    d2,d4        ;Find z + z0
  827.     move.w    #244,d5        ;d5 will be 244-x
  828.     sub.w    d0,d5        ;Find 244-x
  829.     muls    d2,d5        ;Find z*(244-x)
  830.     divs    d4,d5        ;Find delta-x for left eye
  831.     movem.l    d0-d2,-(a7)    ;Save x, y, & z values
  832.     add.w    d5,d0        ;Find x for left eye
  833.     move.w    #199,d5        ;d5 is to be H/2 - y
  834.     sub.w    d1,d5        ;Find H/2 - y
  835.     muls    d2,d5        ;Find z*(H/2 - y)
  836.     divs    d4,d5        ;Find delta-y
  837.     add.w    d1,d5        ;Find new y-coord.
  838.     move.w    d5,d1        ;New y in d1
  839.     move.w    d5,d3        ;Save y in d3
  840.     bsr    setpix    ;Note that setpix uses x=d0, y=d1 and destroys
  841.             ;d1, d2, & a0.  a0 points to absolute address
  842.                 ;where pixel is located in bit plane
  843.     movem.l    (a7)+,d0-d2    ;Recover x, y, & z.
  844.     move.w    #394,d5
  845.     sub.w    d0,d5        ;Find 394-x
  846.     muls    d2,d5        ;Find z*(394-x)
  847.     divs    d4,d5        ;Find delta-x for right eye
  848.     add.w    d5,d0        ;Find new x value for right eye
  849.     move.w    d3,d1        ;Get y
  850.     adda    #4,a3        ;Get blue plane address
  851.     bsr    setpix
  852.     suba    #4,a3        ;Back to pointer for red plane
  853.     movem.l    (a7)+,d0-d7/a0-a2    ;Retrieve all registers
  854.     rts            ;Done for this set of points.    
  855.  
  856. * Point3D takes x, y & z as inputs in registers d0, d1, and d2.  It will
  857. * convert these 3 values to 2 sets of coordinates.  The 1st is the set
  858. * observed by the left eye and the 2nd is that observed by the right eye.
  859. * These pairs are then stored in the buffer areas lefteye & righteye.  A
  860. * point counter is used to offset into these buffers and the counter is
  861. * then incremented.  The half separation of the eyes is assumed to be 75
  862. * pixels, and distance between the observer and screen is 1024 pixels.
  863.  
  864. Point3D:
  865.     movem.l    d0-d7/a0-a2,-(a7)    ;Save the registers
  866.     move.w    #1024,d4    ;d4 will act as z + z0.
  867.     add.w    d2,d4        ;Find z + z0
  868.     move.w    #244,d5        ;d5 will be 244-x
  869.     sub.w    d0,d5        ;Find 244-x
  870.     muls    d2,d5        ;Find z*(244-x)
  871.     divs    d4,d5        ;Find delta-x for left eye
  872.     move.w    PointCount,d6    ;Find #points so far
  873.     add.w    d0,d5        ;Find altered x value for left eye
  874.     move.l    LeftEye,a0    ;Get location of table for left eye
  875.     lsl.w    #2,d6        ;Allow 4 bytes for combined (x,y)
  876.     ext.l    d6
  877.     adda    d6,a0        ;Point to x-coord. for nth point.
  878.     move.w    d5,(a0)+    ;Store and move up for y-coord.
  879.     move.w    #199,d5        ;d5 is to be H/2 - y
  880.     sub.w    d1,d5        ;Find H/2 - y
  881.     muls    d2,d5        ;Find z*(H/2 - y)
  882.     divs    d4,d5        ;Find delta-y
  883.     add.w    d1,d5        ;Find new y-coord.
  884.     move.w    d5,(a0)        ;Store result of y-coord.
  885.     movem.l    d5,-(a7)    ;Push y value
  886.     move.w    #394,d5
  887.     sub.w    d0,d5        ;Find 394-x
  888.     muls    d2,d5        ;Find z*(394-x)
  889.     divs    d4,d5        ;Find delta-x for right eye
  890.     add.w    d0,d5        ;Find new x value for right eye
  891.     move.l    RightEye,a0
  892.     adda    d6,a0        ;Point to current value
  893.     lsr.w    #2,d6        ;Get counter back to actual size
  894.     addq.w    #1,d6        ;Find new count
  895.     move.w    d6,PointCount    ;Store new count
  896.     move.w    d5,(a0)+    ;Store altered x-value
  897.     movem.l    (a7)+,d5    ;Recover y-value
  898.     move.w    d5,(a0)        ;Store y-value
  899.     movem.l    (a7)+,d0-d7/a0-a2    ;Retrieve all registers
  900.     rts            ;Done for this set of points.    
  901.  
  902. * Poly3D has no inputs in registers.  It will complete a sequence of lines
  903. * starting with the first point in the eye buffers and end will the same
  904. * point.  The number of points is indicated by PointCount.  The effect is
  905. * creating a polygon with N segments when there are N pairs of points stored
  906. * in the eye buffers.  Prior to executing, Point3D will have been called at
  907. * least twice.
  908. Poly3D:
  909.     move.w    PointCount,d7    ;Point counter in d7
  910.     move.l    LeftEye,a2
  911.     move.w    (a2)+,d3    ;Get 1st x-value
  912.     move.w    (a2)+,d4    ;& 1st y-value
  913.     ext.l    d3
  914.     ext.l    d4
  915.     movem.l    d3-d4,-(a7)    ;Push 1st point
  916.     subq.w    #1,d7        ;Decrement count
  917. dispol:    move.w    (a2)+,d5    ;Get x2
  918.     move.w    (a2)+,d6    ;& y2
  919.     ext.l    d5
  920.     ext.l    d6
  921.     bsr    AnyLine        ;Display line
  922.     subq.w    #1,d7
  923.     bne.s    dispol
  924.     movem.l    (a7)+,d5-d6    ;Recover 1st point as last
  925.     bsr    AnyLine
  926.     adda.l    #4,a3        ;Forward to color for right eye
  927.     move.w    PointCount,d7    ;Point counter in d7
  928.     move.l    RightEye,a2
  929.     move.w    (a2)+,d3    ;Get 1st x-value
  930.     move.w    (a2)+,d4    ;& 1st y-value
  931.     ext.l    d3
  932.     ext.l    d4
  933.     movem.l    d3-d4,-(a7)    ;Push 1st point
  934.     subq.w    #1,d7        ;Decrement count
  935. poldis:    move.w    (a2)+,d5    ;Get x2
  936.     move.w    (a2)+,d6    ;& y2
  937.     ext.l    d5
  938.     ext.l    d6
  939.     bsr    AnyLine        ;Display line
  940.     subq.w    #1,d7
  941.     bne.s    poldis
  942.     movem.l    (a7)+,d5-d6    ;Recover 1st point as last
  943.     bsr    AnyLine
  944.     suba.l    #4,a3        ;Backward to color for left eye
  945.     move.w    #0,PointCount
  946.     rts
  947.  
  948. *Lines3D is identical to Poly3D, except the polygon isn't closed.  Therefore,
  949. * the line sequence ends on the last point
  950. Lines3D:
  951.     move.w    PointCount,d7    ;Point counter in d7
  952.     move.l    LeftEye,a2
  953.     move.w    (a2)+,d3    ;Get 1st x-value
  954.     move.w    (a2)+,d4    ;& 1st y-value
  955.     ext.l    d3
  956.     ext.l    d4
  957.     movem.l    d3-d4,-(a7)    ;Push 1st point
  958.     subq.w    #1,d7        ;Decrement count
  959. dislin:    move.w    (a2)+,d5    ;Get x2
  960.     move.w    (a2)+,d6    ;& y2
  961.     ext.l    d5
  962.     ext.l    d6
  963.     bsr    AnyLine        ;Display line
  964.     subq.w    #1,d7
  965.     bne.s    dislin
  966.     movem.l    (a7)+,d5-d6    ;Recover 1st point as last
  967.     adda.l    #4,a3        ;Forward to color for right eye
  968.     move.w    PointCount,d7    ;Point counter in d7
  969.     move.l    RightEye,a2
  970.     move.w    (a2)+,d3    ;Get 1st x-value
  971.     move.w    (a2)+,d4    ;& 1st y-value
  972.     ext.l    d3
  973.     ext.l    d4
  974.     movem.l    d3-d4,-(a7)    ;Push 1st point
  975.     subq.w    #1,d7        ;Decrement count
  976. lindis:    move.w    (a2)+,d5    ;Get x2
  977.     move.w    (a2)+,d6    ;& y2
  978.     ext.l    d5
  979.     ext.l    d6
  980.     bsr    AnyLine        ;Display line
  981.     subq.w    #1,d7
  982.     bne.s    lindis
  983.     movem.l    (a7)+,d5-d6    ;Recover 1st point as last
  984.     suba.l    #4,a3        ;Backward to color for left eye
  985.     move.w    #0,PointCount
  986.     rts
  987. * One3D has no inputs in registers.  It will draw one 3D line starting with
  988. * the first point in the eye buffers and ending with the 2nd point.  Prior
  989. * to executing, Point3D will have been called exactly twice.
  990. One3D:
  991.     move.l    LeftEye,a2
  992.     move.w    (a2)+,d3    ;Get 1st x-value
  993.     move.w    (a2)+,d4    ;& 1st y-value
  994.     ext.l    d3
  995.     ext.l    d4
  996.     move.w    (a2)+,d5    ;Get x2
  997.     move.w    (a2)+,d6    ;& y2
  998.     ext.l    d5
  999.     ext.l    d6
  1000.     bsr    AnyLine        ;Display line
  1001.     adda.l    #4,a3        ;Forward to color for right eye
  1002.     move.l    RightEye,a2
  1003.     move.w    (a2)+,d3    ;Get 1st x-value
  1004.     move.w    (a2)+,d4    ;& 1st y-value
  1005.     ext.l    d3
  1006.     ext.l    d4
  1007.     move.w    (a2)+,d5    ;Get x2
  1008.     move.w    (a2)+,d6    ;& y2
  1009.     ext.l    d5
  1010.     ext.l    d6
  1011.     bsr    AnyLine        ;Display line
  1012.     suba.l    #4,a3        ;Backward to color for left eye
  1013.     move.w    #0,PointCount
  1014.     rts
  1015. noline:    rts
  1016. * vertline will have its inputs as x1(d3),y1(d4),y2(d5) with x2=x1
  1017. vertline:
  1018.     cmp.l    d4,d6        ;See if only point
  1019.     beq.s    noline
  1020.     movem.l    d3-d6,-(a7)    ;Push current values
  1021.     move.l    #1,d2        ;Will be in quadrant 2 if plus
  1022.     sub.w    d4,d6        ;Find y2 - y1
  1023.     bpl.s    postiv        ;Already plus
  1024.     move.l    #3,d2        ;4th quadrant if negative
  1025.     neg.w    d6        ;Make delta-y plus
  1026. postiv:    move.w    d3,d0        ;Get x1 into d0
  1027.     move.w    d4,d1        ; & y1 into d1
  1028.     move.w    #SHeight,d3    ;Get screen height in d3
  1029.     cmp.w    #400,d3        ;See if interlace
  1030.     beq.s    samkep        ;Keep same if interlace
  1031.     asr.w    #1,d6        ;Halve delta-y
  1032. samkep:    move.w    d6,d3        ;d3 has delta-y (as deltax in NewLine)
  1033.     move.w    #0,d4        ;deltay in NewLine is 0
  1034.     addi.l    #4,d2        ;Offset for steep slopes
  1035.     lsl.l    #1,d2        ;Double offset
  1036.     lea    octcod,a1    ;Get table location
  1037.     adda    d2,a1        ;Find pointer to table
  1038.     move.w    (a1),d2        ;Get octant code
  1039.     ori.w    #SIGNFLAG,d2    ;Set sign flag
  1040.     bsr    NewLine
  1041.     movem.l    (a7)+,d3-d6    ;Pop values
  1042.     move.l    d5,d3    ;Get x2 into x1
  1043.     move.l    d6,d4    ;Get y2 into y1
  1044.     rts
  1045. * AnyLine will take input for x1 in d3, y1 in d4, x2 in d5 and y2 in d6
  1046. * It will determine if the slope is 0 or infinite and accordingly branch
  1047. * to horzline or vertline.  If neither, it will determine the values for
  1048. * delta-x and delta-y, determine the quadrant and call NewLine.
  1049. AnyLine:
  1050.     cmp.w    d3,d5        ;See if x1=x2
  1051.     beq    vertline
  1052.     cmp.w    d4,d6        ;See if y1=y2
  1053.     beq    horzline
  1054.     movem.l    d3-d5,-(a7)
  1055.     move.w    #0,d2        ;Quadrant # 0 to start with
  1056.     move.w    d3,d0        ;x1 into d0
  1057.     move.w    d4,d1        ;y1 into d1
  1058.     move.w    d5,d3        ;x2 into d3
  1059.     move.w    d6,d4        ;y2 into d4
  1060.     sub.w    d0,d3        ;Find delta-x
  1061. ishirs:    tst.w    d3        ;See if negative
  1062.     bmi.s    quad23        ;If negative its in 2nd or 3rd quadrant
  1063. quad14:    sub.w    d1,d4        ;Find delta-y
  1064. isintl:    tst.w    d4
  1065.     bmi.s    quad4        ;It's quadrant 4
  1066. quad1:    move.l    #0,d2
  1067.     bra    octsel        ;It's quadrant 1, n = 0
  1068. quad4:    move.l    #3,d2        ;It's quadrant four
  1069.     neg.w    d4        ;Make delta-y +
  1070.     bra    octsel
  1071. quad23:    sub.w    d1,d4        ;Find delta-y
  1072. intoo:    tst.w    d4        ;See if -
  1073.     bmi.s    quad3
  1074. quad2:    move.l    #1,d2
  1075.     neg.w    d3        ;Make delta-x +
  1076.     bra    octsel    
  1077. quad3:    move.l    #2,d2        ;Quadrant number is 3
  1078.     neg.w    d3        ;Make deltax +
  1079.     neg.w    d4        ;Same for delta y
  1080. octsel:    cmp.w    d3,d4        ;See if delta-x less than delta-y
  1081.     bmi.s    smallslope
  1082.     add.l    #4,d2        ;Add in 4 more through table
  1083.     move.l    d3,-(a7)    ;Push delta x
  1084.     move.l    d4,d3        ;Get delta y into delta x
  1085.     move.l    (a7)+,d4    ;Pop as delta y
  1086. smallslope:
  1087.     lsl.l    #1,d2        ;Go to select octant
  1088.     lea    octcod,a1
  1089.     adda    d2,a1
  1090.     move.w    (a1),d2        ;Get octant code
  1091.     bsr    NewLine        ;Draw line    
  1092.     movem.l    (a7)+,d3-d5
  1093.     move.w    d5,d3        ;Make x1 = old x2
  1094.     move.w    d6,d4        ;Make y1 = old y2
  1095.     rts
  1096. * horzline will have its inputs as x1(d3),y1(d4),x2(d5) with y2=y1
  1097. * d2 will contain the value of delta-x
  1098. horzline:
  1099.     movem.l    d3-d7,-(a7)    ;Push current values
  1100.     move.l    #0,d2        ;Quadrant 1 if y1>y2
  1101.     sub.w    d3,d5        ;Find deltax
  1102.     bpl.s    plus        ;Already plus
  1103.     move.l    #2,d2        ;Quadrant 4 is -
  1104.     neg.w    d5        ;Make deltax +
  1105. plus:    move.w    d3,d0        ;Get x1 into d0
  1106.     move.w    d4,d1        ;& y1 into d1
  1107.     move.w    #SWidth,d3    ;Get screen width into d3
  1108.     cmp.w    #640,d3        ;See if high res.
  1109.     beq.s    kepsam
  1110.     lsr.w    #1,d5        ;Halve delta x
  1111. kepsam:
  1112.     move.w    d5,d3
  1113.     move.w    #0,d4        ;Make deltay = 0
  1114.     lsl.l    #1,d2        ;Double offset
  1115.     lea    octcod,a1
  1116.     adda    d2,a1        ;Find pointer to table
  1117.     move.w    (a1),d2        ;Get octant code
  1118.     ori.w    #SIGNFLAG,d2
  1119.     bsr    NewLine
  1120.     movem.l    (a7)+,d3-d7
  1121. okay:    move.l    d5,d3        ;Get x2 into x1
  1122.     move.l    d6,d4        ;Get y2 into y1
  1123.     rts
  1124. ResView:
  1125.     movem.l    d0-d7/a0-a6,-(a7)
  1126.     move.l    #CommandD,d1
  1127.     bsr    DoIt            ;Do assign c: sys:c
  1128. *    bsr    RestoreSprite
  1129.     move.l    IntuitionLibrary,a6
  1130.     move.l    MyScreenA,a0
  1131.     jsr    _LVOScreenToBack(a6)    ;Hide both custom screens.
  1132.     move.l    MyScreenB,a0
  1133.     jsr    _LVOScreenToBack(a6)
  1134.     lea    HomeIt,a0
  1135.     bsr    StrWrite
  1136.     lea    Caution,a0
  1137.     bsr    TransIt
  1138.     lea    MyString,a0
  1139.     bsr    TransIt
  1140.     bsr    SpcWait
  1141. *    bsr    SpriteClear
  1142.     move.l    #CommandC,d1
  1143.     bsr    DoIt            ;Do assign c: ram:c
  1144.     movem.l    (a7)+,d0-d7/a0-a6
  1145.     rts
  1146. MyDelay:
  1147.     move.l    a6,-(a7)
  1148.     move.l    DosLibrary,a6
  1149.     move.l    #200,d1
  1150.     jsr    _LVODelay(a6)
  1151.     move.l    (a7)+,a6
  1152.     rts
  1153. *setpix has inputs of d0.w for x, d1.w for y, and a3 for the video pointer
  1154. * Registers affected include d1, d2, and a0. It returns with the address
  1155. * of the pixel in a0 and the bit to be set or cleared in d1
  1156. setpix:
  1157.     move.w    d1,d2        ;See if y is - and get into d2
  1158.     bmi.s    setnot        ;Don't set if negative
  1159. intlce:    move.w    #S1Height,d2
  1160.     sub.w    d1,d2        ;*;Find 199-y
  1161.     bcs.s    setnot        ;* ;Don't set if y1 > yupper.
  1162.     move.w    d1,d2
  1163.     move.w    d0,d1        ;See if x is negative
  1164.     bmi.s    setnot        ;Don't set if is
  1165.     cmp.w    #S1Width,d0
  1166.     bgt.s    setnot        ;bcc.s    setnot        ;If no carry then too big
  1167.     move.w    d2,d1        ;Save y  in d1
  1168.     lsl.w    #6,d1        ;d1 is 32y
  1169.     lsl.w    #4,d2        ;d2 is 8y
  1170.     add.w    d1,d2        ;d2 is 80y  (40y)
  1171. nrmres:    move.w    d0,d1        ;d1 is x
  1172.     lsr.w    #3,d1        ;d1 is x/8
  1173.     add.w    d1,d2        ;d2 is offset for memory location
  1174.     move.l    (a3),a0        ;Point to beginning of memory****was (a3)
  1175.     adda.l    d2,a0        ;Add in offset
  1176.     move.w    d0,d1        ;d1 is x
  1177.     eori.w    #7,d1        ;Toggle lowest 3 bits.
  1178.     andi.w    #7,d1        ;Get 7 - x(mod 8)
  1179.     bset    d1,(a0)        ;Set bit 7-x(mod8)
  1180. setnot:    rts
  1181. TabCom:
  1182.     move.l    CosTab,a0    ;Get beginning of Cos and end of Sin
  1183.     move.l    a0,a1
  1184.     move.w    (a1)+,d0    ;Move destination up 1 word.
  1185.     move.b    #90,d0
  1186. movtab:    move.w    -(a0),(a1)+    ;Transfer 1 word of table
  1187.     subq.b    #1,d0        ;Decrement counter
  1188.     bne.s    movtab        ;Repeat until 89 values moved.
  1189.     move.l    SinTab,a0
  1190.     move.l    CosTab,a1
  1191.     adda    #180,a1        ;Point to cosine 90 degrees
  1192.     move.w    #272,d0
  1193. tabmov:    move.w    (a0)+,d1
  1194.     neg.w    d1
  1195.     move.w    d1,(a1)+    ;Store - sine
  1196.     subq.w    #1,d0
  1197.     bne.s    tabmov        ;Now have through sine(360)
  1198.     move.l    CosTab,a0
  1199.     adda    #180,a0        ;Point to cos(90)
  1200.     move.w    #0,(a0)        ;0 sin(180)
  1201.     rts
  1202. ClearOne:
  1203.     move.l    PnPtr0,a3
  1204.     move.l    a3,PagNum
  1205.     bra.s    clears        ;Plane both of bit planes for page one
  1206. ClearTwo:
  1207.     move.l    PnPtr1,a3
  1208.     move.l    a3,PagNum
  1209. clears:    move.l    a3,a0
  1210.     move.l    #0,d3
  1211.     bsr.s    clearshort
  1212.     move.l    a3,a0
  1213.     move.l    #1,d3
  1214. clearshort:
  1215.     movem.l    d0-d1,-(a7)
  1216.     move.l    d3,d1        ;Get bit plane number into d1
  1217.     lsl.l    #2,d1        ;Quadruple offset
  1218.     adda    d1,a0
  1219.     movea.l    (a0),a1        ;Get address of screen.
  1220.     adda.l    TopOffset,a1    ;# bytes = 80 times #lines
  1221.     move.w    #SHeight,d0    ;Get screen height
  1222. *    sub.w    #54,d0        ;Less 74 scan lines
  1223.     sub.w    BottomOffset,d0
  1224.     mulu    #SWidth,d0    ; times width
  1225.     lsr.l    #3,d0        ;Find number of bytes
  1226.     move.l    #1,d1        ;Set up flags for waiting on blitter.
  1227. *Note: BltClear does not cause the problem with disk access.
  1228.     jsr    _LVOBltClear(a6)    ;Clear the screen.
  1229.     movem.l    (a7)+,d0-d1
  1230.     rts
  1231. *DrawNot will be reached if x1 or y1 is negative, or if both delta-x &
  1232. * delta-y are 0.
  1233. DrawNot:
  1234.     rts
  1235. * NewLine has inputs as follows.  x1, y1 in d0 & d1 for input to setpix
  1236. *d2 has the octant number, with d3 & d4 being delta-x & delta-y respectively
  1237. NewLine:
  1238.     ori.w    #1,d2        ;Line mode,solid line
  1239. * Will use ori.w #3 for single bit/scanline
  1240.     move.w    d2,(BLTCON1+CHPADR)
  1241.     bsr    setpix
  1242.     move.l    a0,(BLTCPTH+CHPADR)    ;a0 has pixel location
  1243.     move.l    a0,(BLTDPTH+CHPADR)
  1244.     andi.w    #$F,d0        ;Mask off above 15.
  1245.     move.b    #12,d5        ;Want to shift 12 bits.
  1246.     lsl.w    d5,d0        ;d0 now has start position.
  1247. *    ori.w    #$BFA,d0    ;Add in start position to #$B4A
  1248.     ori.w    #$BC8,d0
  1249. * $4A is used for ((not A and B) or (AB and not C)
  1250. * $FA would be used for A or C, and $C8 for (A + C)B == texture
  1251.     move.w    d0,(BLTCON0+CHPADR)
  1252.     move.w    d4,d1        ;Get dy
  1253.     bmi.s    DrawNot        ;No - dy allowed
  1254.     move.w    d3,d0        ;Get dx
  1255.     bmi.s    DrawNot
  1256.     or.w    d0,d1        ;Or deltax & deltay
  1257.     beq.s    DrawNot        ;Don't draw if both 0
  1258. *    move.l    a6,-(a7)    ;Save Lib pointer
  1259. *    move.l    _AbsExecBase,a6    ;Get exec lib.
  1260.     move.w    d4,d1        ;Get dy again
  1261.     sub.w    d0,d1        ;d(y-x) into d1
  1262.     asl.w    #2,d1        ;4*d(y-x) into d1
  1263.     move.w    d1,(BLTAMOD+CHPADR);Store 4(y-x) in BLTAMOD
  1264.     move.w    d4,d1        ;Get dy again
  1265.     asl.w    #2,d1        ;4dy in d1
  1266.     move.w    d1,(BLTBMOD+CHPADR)    
  1267.     move.w    #$8000,(BLTADAT+CHPADR)        ;Index register
  1268.     move.w    TXTURE,(BLTBDAT+CHPADR)        ;Solid lines
  1269.     asl.w    #1,d4        ;Find 2dy
  1270.     sub.w    d3,d4        ;2y-x ind d4 now
  1271.     move.w    d4,(BLTAPTL+CHPADR)    ;2y-x into BLTAPTL
  1272.     move.w    bytwidth,(BLTCMOD+CHPADR)    ;#$50,(BLTCMOD+CHPADR)        ;Screen width
  1273.     move.w    bytwidth,(BLTDMOD+CHPADR)    ;#$50,(BLTDMOD+CHPADR)
  1274.     move.l    #$FFFFFFFF,(BLTAFWM+CHPADR) ;Make mask high for 1st & last
  1275.     move.w    #$8140,d0        ;Code for blitter enable.
  1276.     asl.w    #6,d3            ;Shift left 6 bits (64 delta-x)
  1277.     ori.w    #2,d3            ;Set line draw bit.
  1278. DskChk:    move.w    (INTREQR+CHPADR),d1    ;Check request status for disk
  1279.     btst    #4,d1            ;See if request pending
  1280.     bne.s    DskChk            ;Wait until not requested.
  1281. StsWat:    move.w    (DMACONR+CHPADR),d1    ;Get enable status
  1282.     btst    #4,d1            ;Keep checking until DSKEN off
  1283.     beq.s    StsWat
  1284.     btst    #14,d1            ;See if busy
  1285.     bne.s    StsWat
  1286.     or.w    d1,d0            ;Keep status same for copper, etc.
  1287.     bset    #10,d0            ;Turn on blitter nasty
  1288. *    move.w    #$4000,_intena
  1289. *    addq.b    #1,IDNestCnt(a6)
  1290. ntnst4:    move.w    d0,(DMACONW+CHPADR)    ;Enable the blitter.
  1291.     move.w    d3,(BLTSIZE+CHPADR)    ;Send out line size to start it.
  1292. watsts:    move.w    (DMACONR+CHPADR),d0    ;Get current status
  1293.     btst    #14,d0        ;See if busy
  1294.     bne.s    watsts
  1295. *    subq.b    #1,IDNestCnt(a6)
  1296. *    bge.s    EnableDone
  1297. *    move.w    #$C000,_intena
  1298. EnableDone:
  1299. *    move.l    (a7)+,a6    ;Recover library pointer
  1300.     rts            ;Back to work.
  1301. NxtPnt:    move.l    (a4)+,d0
  1302.     move.l    (a4)+,d1
  1303.     move.l    #0,d2
  1304.     move.l    a4,-(a7)
  1305.     bsr    PolyVector
  1306.     move.l    (a7)+,a4
  1307.     rts
  1308. AmigaName:
  1309.     movem.l    d0-d5/a4,-(a7)
  1310.     lea    AName,a4
  1311.     bsr.s    ClosedPoly    ;Outer part of 1st A
  1312.     bsr.s    ClosedPoly    ;Inner part of 1st A
  1313.     bsr.s    ClosedPoly    ;M
  1314.     bsr.s    ClosedPoly    ;I
  1315.     bsr.s    ClosedPoly    ;G
  1316.     bsr.s    ClosedPoly    ;Exterior of 2nd A
  1317.     bsr.s    ClosedPoly    ;Interior of 2nd A
  1318.     movem.l    (a7)+,d0-d5/a4
  1319.     rts
  1320. ClosedPoly:
  1321.     move.l    #0,d2
  1322.     move.l    #0,d5
  1323. PolyClose:
  1324.     move.w    (a4)+,d1
  1325.     move.w    (a4),d0
  1326.     ext.l    d0
  1327.     ext.l    d1
  1328.     move.l    d1,FirstY
  1329.     move.l    d0,FirstX
  1330.     subq.w    #2,a4
  1331. DoLine:    move.w    (a4)+,d1
  1332.     move.w    (a4)+,d0
  1333.     move.l    a4,-(a7)    ;Save beginning point
  1334.     ext.l    d0
  1335.     ext.l    d1
  1336.     move.w    (a4)+,d4
  1337.     move.w    (a4)+,d3
  1338.     ext.l    d3
  1339.     ext.l    d4
  1340.     cmp.l    FirstY,d4    ;See if last point
  1341.     bne.s    NotLast
  1342.     cmp.l    FirstX,d3
  1343.     beq.s    LastPoint
  1344. NotLast:
  1345.     movem.l    d2/d5,-(a7)
  1346.     bsr    Vector
  1347.     movem.l    (a7)+,d2/d5
  1348.     move.l    (a7)+,a4
  1349.     bra.s    DoLine
  1350. LastPoint:
  1351.     bsr    Vector
  1352.     move.l    (a7)+,a4
  1353.     addq.l    #4,a4    ;Get to beginning of next table
  1354.     rts
  1355. Spiral:
  1356.     lea    ThetaTotal,a0
  1357.     move.l    #0,(a0)        ;Initial value of theta
  1358. NxtSprl:
  1359.     move.l    a0,-(a7)
  1360.     bsr    Rosette
  1361.     bsr    Plot3D
  1362.     move.l    (a7)+,a0
  1363.     move.l    DTheta,d0
  1364.     add.l    d0,(a0)
  1365.     cmp.l    #180,(a0)    ;ytemp
  1366.     ble.s    NxtSprl
  1367.     bsr    Lines3D
  1368. ThetaChange:
  1369.     addq.l    #8,ThetaNew
  1370.     cmp.l    #360,ThetaNew
  1371.     blt.s    NewOK
  1372.     sub.l    #360,ThetaNew
  1373. NewOK:    rts
  1374. ChangeTheta:
  1375.     move.l    DTheta,d0
  1376.     lsr.l    #5,d0
  1377.     cmp.w    #135,FrmCnt
  1378.     bge.s    LT180
  1379.     cmp.w    #45,FrmCnt
  1380.     blt.s    LT180
  1381.     add.l    d0,Theta
  1382.     cmp.l    #360,Theta
  1383.     ble.s    OKTheta
  1384.     sub.l    #360,Theta
  1385.     bra.s    OKTheta
  1386. LT180:    sub.l    d0,Theta
  1387.     bpl.s    OKTheta
  1388.     add.l    #360,Theta
  1389. OKTheta:
  1390.     move.l    DPhi,d0
  1391.     lsr.l    #5,d0
  1392.     add.l    d0,Phi
  1393.     cmp.l    #360,Phi
  1394.     blt.s    OKPhi
  1395.     sub.l    #360,Phi
  1396. OKPhi:    move.l    SinTab,a0
  1397.     move.l    CosTab,a1
  1398.     move.l    Theta,d0
  1399.     lsl.l    #1,d0        ;Get offset in trig table.
  1400.     add.l    d0,a1
  1401.     add.l    d0,a0
  1402.     move.w    (a0),d1        ;Get sin
  1403.     move.w    (a1),d0        ;Get cos
  1404.     ext.l    d0
  1405.     ext.l    d1
  1406.     asr.l    #7,d0
  1407.     asr.l    #7,d1        ;Get actual value times 128    
  1408.     bsr    MakChg
  1409.     move.l    d0,yoffset
  1410.     move.l    d1,zoffset
  1411.     addq.w    #1,FrmCnt
  1412.     rts
  1413. MakChg:
  1414.     add.l    #64,d1
  1415.     cmp.w    #135,FrmCnt
  1416.     bge.s    GT540
  1417.     cmp.w    #45,FrmCnt
  1418.     bge.s    SecHal
  1419. GT540:    neg.l    d0
  1420.     cmp.w    #180,FrmCnt
  1421.     blt.s    ChgDon
  1422.     bne.s    Not180
  1423. ChkPnd:    move.l    PendIO,d0    ;See if anything pending
  1424.     beq.s    MesDon
  1425.     bsr    CheckIt
  1426.     bra.s    ChkPnd
  1427. MesDon:    bsr    SetMale
  1428.     lea    Mes3,a0
  1429.     move.b    #7,d0
  1430. NxMes3:    bsr    TransIt
  1431.     sub.b    #1,d0
  1432.     bne.s    NxMes3
  1433.     bsr    SetFemale
  1434. Not180:    add.l    #1,DTheta
  1435.     add.l    #1,DPhi
  1436.     move.l    yoffset,d0
  1437.     move.l    zoffset,d1
  1438.     tst.l    DZ
  1439.     ble    Retrip
  1440.     sub.l    DZ,d1
  1441.     add.l    #1,DZ
  1442.     cmp.l    #-4000,d1
  1443.     bgt.s    IsClose
  1444.     neg.l    DZ
  1445.     lea    TabAmy,a1
  1446.     move.l    (a1)+,a0
  1447.     move.l    a1,CurAmy
  1448.     bsr    Async
  1449. IsClose:
  1450.     move.l    #0,d0
  1451. ChgDon:    rts
  1452. SecHal:    add.l    #128,d1
  1453.     neg.l    d1
  1454.     rts
  1455. Retrip:    cmp.w    #1024,FrmCnt
  1456.     bge    EndLst        ;End of last (actually next to last) sequence
  1457.     tst.l    DZ
  1458.     beq.s    LstPas
  1459.     sub.l    DZ,d1
  1460.     add.l    #1,DZ
  1461.     bsr    CheckIt
  1462.     cmp.l    #-100,d1
  1463.     ble.s    IsClose
  1464.     move.l    #0,DZ
  1465. ChkPd2:    move.l    PendIO,d2    ;See if io still pending
  1466.     beq.s    IO2Don
  1467.     bsr    CheckIt
  1468.     bra.s    ChkPd2
  1469. IO2Don:    bsr    SetMale
  1470.     lea    DaveTab,a1
  1471.     move.l    (a1)+,a0
  1472.     move.l    a1,CurAmy
  1473.     bsr    Async
  1474.     bra.s    IsClose
  1475. LstPas:
  1476.     move.l    PendIO,d2    ;Get io status
  1477.     bne.s    IsClose
  1478.     cmp.w    #1000,FrmCnt
  1479.     blt    StrtLst
  1480.     bra    IsClose
  1481. StrtLst:
  1482.     bsr    Second
  1483.     bsr    Third
  1484.     bsr    SetFemale
  1485.     lea    LateAmy,a1
  1486.     move.l    (a1)+,a0
  1487.     move.l    a1,CurAmy
  1488.     bsr    Async
  1489.     bsr    NewColor
  1490.     move.w    #1000,FrmCnt
  1491.     bsr    ScreenDown
  1492.     move.l    #-600,d1    ;Move further away
  1493.     bra    IsClose
  1494. EndLst:    cmp.w    #4000,FrmCnt    ;See if on last pass
  1495.     bgt.s    PasLst
  1496.     bsr    CheckIt
  1497.     move.l    PendIO,d2
  1498.     bne    IsClose
  1499.     move.w    #4000,FrmCnt    ;Start frame count high
  1500. *    bsr    ScreenUp
  1501. PasLst:    cmp.w    #4030,FrmCnt
  1502.     ble    IsClose
  1503.     adda.l    #12,a7        ;Balance Stack
  1504.     bra    CorkScrew
  1505. Rosette:
  1506.     movem.l    d0-d3/a0-a2,-(a7)
  1507.     move.b    #8,d3
  1508.     move.w    Leaf,d1        ;Count of # of leaves
  1509.     bsr    SinGet
  1510.     move.w    d0,rho        ;Store 64*cos(3*theta) in rho
  1511.     move.w    #1,d1
  1512.     bsr    CosGet
  1513.     muls    rho,d0
  1514.     asr.l    d3,d0
  1515.     move.l    d0,xtemp
  1516.     bsr    SinGet
  1517.     muls    rho,d0
  1518.     asr.l    d3,d0
  1519.     move.l    d0,ytemp
  1520.     move.w    rho,d0
  1521.     muls    d0,d0
  1522.     move.w    #1,d1
  1523.     move.l    ThetaNew,d2
  1524.     move.l    d0,d5
  1525.     move.l    (a0),d4
  1526.     move.l    d2,(a0)
  1527.     bsr.s    CosGet
  1528.     move.l    d4,(a0)
  1529.     muls    d5,d0
  1530.     asr.l    d3,d0
  1531.     sub.b    #1,d3
  1532.     asr.l    d3,d0
  1533.     move.l    d0,z
  1534.     movem.l    (a7)+,d0-d3/a0-a2
  1535.     rts
  1536. CosGet:
  1537.     move.l    CosTab,a1
  1538. TrgVal:    move.l    (a0),d0        ;Get theta
  1539.     lsl.l    #1,d0        ;Double for short word table
  1540.     muls    d1,d0        ;Include multiplier
  1541. ChkSiz:    cmp.l    #720,d0        ;See if beyond table
  1542.     ble.s    SmlEnf
  1543.     sub.l    #720,d0
  1544.     bra.s    ChkSiz
  1545. SmlEnf:    add.l    d0,a1        ;Get sine location
  1546.     move.w    (a1),d0        ;Get trig value
  1547.     ext.l    d0
  1548.     asr.l    #7,d0
  1549.     rts
  1550. SinGet:
  1551.     move.l    SinTab,a1
  1552.     bra.s    TrgVal
  1553. SetWhite:
  1554.     lea    WhiteScript,a0
  1555.     bsr    StrWrite
  1556.     rts
  1557. SetOrange:
  1558.     lea    OrangeScript,a0
  1559.     bsr    StrWrite
  1560.     rts
  1561. PageTitle:
  1562.     move.l    GraphicsLibrary,a6
  1563.     bsr    SetWhite
  1564.     lea    LinFed,a0
  1565.     bsr    StrWrite
  1566.     lea    IntMes0,a0
  1567.     move.l    #4,d3
  1568.     bsr    CtrBlock
  1569.     bsr    SetOrange
  1570.     lea    IntMes1,a0
  1571.     move.l    #1,d3
  1572.     bsr    CtrWrite
  1573.     bsr    CopyFiles
  1574.     lea    MenStr,a0
  1575.     bsr    TransIt
  1576.     bsr    TransIt
  1577.     bsr    SetWhite
  1578.     lea    IntMes2,a0
  1579.     move.l    #2,d3
  1580.     bsr    CtrBlock
  1581.     bsr    SetUp
  1582.     lea    AnCmd,a0
  1583.     bsr    TabWrite
  1584.     bsr    TabWrite
  1585.     lea    Remem,a0
  1586.     bsr    TransIt
  1587.     bsr    TransIt
  1588.     lea    DefStr,a0
  1589.     bsr    TransIt
  1590.     bsr    TransIt
  1591.     lea    SpcStr,a0
  1592.     bsr    CtrWrite
  1593. * Wait for keyboard input
  1594. Wait:    move.l    #0,MyBuffer    ;Clear input buffer
  1595.     move.l    ConIO,a1
  1596.     move.l    #0,IO_ACTUAL(a1)
  1597.     move.w    #20,d3
  1598.     move.w    #1,LoopCnt    ;Default value
  1599. WaitSpc:
  1600.     move.w    d3,-(a7)
  1601.     bsr.s    ShrtDelay
  1602.     bsr    KeyRead        ;Read single key using quick-io
  1603.     move.w    (a7)+,d3
  1604.     cmp.b    #$20,d0
  1605.     beq.s    WasSpc
  1606.     subq.w    #1,d3
  1607.     bne.s    WaitSpc
  1608.     move.l    ConIO,a1
  1609.     bsr.s    AbortIt
  1610.     move.l    #0,MyBuffer
  1611.     rts
  1612. WasSpc:    move.l    ConIO,a1
  1613.     bsr.s    AbortIt
  1614.     move.w    #0,LoopCnt
  1615.     move.l    #0,MyBuffer    ;Flush buffer
  1616.     rts
  1617. SpcWait:
  1618.     move.l    #0,MyBuffer    ;Clear input buffer
  1619.     move.l    ConIO,a1
  1620.     move.l    #0,IO_ACTUAL(a1)
  1621. WaitHere:
  1622.     bsr    KeyRead        ;Read single key using quick-io
  1623.     cmp.b    #$20,d0
  1624.     beq.s    WasSpc
  1625.     bra.s    WaitHere    ;SpcWait only acknowledges space bar
  1626. ShrtDelay:
  1627.     move.l    a6,-(a7)
  1628.     move.l    DosLibrary,a6
  1629.     move.l    #10,d1
  1630.     jsr    _LVODelay(a6)
  1631.     move.l    (a7)+,a6
  1632.     rts
  1633. *SaveSprite:
  1634. *    move.w    #$120,d1
  1635. *    move.w    #$122,d2
  1636. *    move.l    #0,a0
  1637. *DoSrch:    move.w    (a0)+,d3
  1638. *    cmp.w    d1,d3    
  1639. *    bne.s    DoSrch
  1640. *    move.w    (a0)+,d0    ;Move past data word
  1641. *    move.w    (a0),d3
  1642. *    cmp.w    d2,d3
  1643. *    bne.s    DoSrch
  1644. *    suba    #2,a0        ;Back up to SPR0PTH
  1645. *    move.l    (a0)+,d0    ;Get value of SPR0PTH
  1646. *    move.l    d0,(SpriteSave)    ;Store msw
  1647. *    move.w    (a0),d1        ;Get lsw of pointer (i.e. SPR0PTL)
  1648. *    move.w    d1,(SpriteSave+2)
  1649. *    move.l    (SpriteSave),a0    ;Get address of pointer
  1650. *    adda    #4,a0        ;Move up to table for sprite
  1651. *    move.l    a0,(SpriteSave)
  1652. *    move.l    SpriteBuffer,a1    ;Point to buffer for saving sprite data.
  1653. *    move.b    #16,d1        ;Counter for number of words to move.
  1654. *    bra.s    blkmov        ;Transfer data of original sprite
  1655. *SpriteClear:
  1656. *    btst.b    #0,SprSts
  1657. *    beq.s    IsCler
  1658. *    move.b    #16,d1
  1659. *    move.l    (SpriteSave),a0
  1660. *bufclr:    move.l    #0,(a0)+
  1661. *    subq.b    #1,d1
  1662. *    bne.s    bufclr
  1663. *    move.l    MyScreenA,a0
  1664. *    move.l    sc_MouseY(a0),d0
  1665. *    move.l    d0,LastMouse
  1666. *    move.w    #0,MouCnt
  1667. *    bclr.b    #0,SprSts
  1668. *IsCler:    rts
  1669. *RestoreSprite:
  1670. *    btst.b    #0,SprSts    ;See if pointer already displayed.
  1671. *    bne.s    SprtOn
  1672. *    movem.l    a0-a1,-(a7)
  1673. *    move.l    (SpriteSave),a1    ;Get address of pointer
  1674. *    move.l    SpriteBuffer,a0    ;Pointer to buffer for recover sprite data
  1675. *    move.b    #16,d1        ;Counter for number of words to move.
  1676. *    bsr    blkmov
  1677. *    movem.l    (a7)+,a0-a1
  1678. *SprtOn:    bset.b    #0,SprSts
  1679. *    rts
  1680. *blkmov:
  1681. *    move.l    (a0)+,(a1)+
  1682. *    subq.b    #1,d1        ;Decrement counter
  1683. *    bne.s    blkmov
  1684. *    rts
  1685. PortCreate:
  1686.     move.l    #-1,d0
  1687.     jsr    _LVOAllocSignal(a6)
  1688.     move.l    d0,Signal
  1689.     cmp.l    #-1,d0
  1690.     beq.s    NoSignal
  1691.     move.l    #MP_SIZE,d0
  1692.     bsr    StructureAlloc
  1693.     move.l    d0,MsgPort
  1694.     beq.s    MemFail
  1695.     move.l    d0,a2
  1696.     move.l    #0,LN_NAME(a2)
  1697.     move.b    #0,LN_PRI(a2)
  1698.     move.b    #NT_MSGPORT,LN_TYPE(a2)
  1699.     clr.b    MP_FLAGS(a2)
  1700.     move.l    Signal,d0
  1701.     move.b    d0,MP_SIGBIT(a2)
  1702. NoSignal:
  1703.     rts
  1704. TaskFind:
  1705.     move.l    #0,a1
  1706.     jsr    _LVOFindTask(a6)
  1707.     move.l    d0,MP_SIGTASK(a2)
  1708.     move.l    a2,a0
  1709.     add.l    #MP_MSGLIST,a0
  1710.     move.l    a0,(a0)
  1711.     addq.l    #4,(a0)
  1712.     clr.l    4(a0)
  1713.     move.l    a2,d0
  1714.     rts
  1715. MemFail:
  1716.     move.l    Signal,d0
  1717.     jsr    _LVOFreeSignal(a6)
  1718.     rts
  1719. PortDelete:
  1720.     move.l    MsgPort,d0
  1721.     beq.s    NoPort
  1722.     move.l    d0,a1
  1723.     move.b    #-1,LN_TYPE(a1)
  1724.     moveq    #-1,d2
  1725.     move.l    d2,MP_MSGLIST(a1)
  1726.     moveq    #0,d2
  1727.     move.b    MP_SIGBIT(a1),d0
  1728.     jsr    _LVOFreeSignal(a6)
  1729.     move.l    #MP_SIZE,d0
  1730.     move.l    MsgPort,a1
  1731.     bsr    StructFree
  1732.     move.l    #0,MsgPort
  1733. NoPort:    rts
  1734. SpeakPort:
  1735.     move.l    a6,-(a7)
  1736.     move.l    _AbsExecBase,a6
  1737.     move.l    #NDI_SIZE,d0
  1738.     bsr    StructureAlloc
  1739.     move.l    d0,SpeakIO    ;Save pointer to IO request block
  1740.     bsr    PortCreate
  1741.     bsr    TaskFind
  1742.     move.l    MsgPort,a1
  1743.     move.l    a1,MsgPortN
  1744.     move.l    Signal,a1
  1745.     move.l    a1,SignalN
  1746.     move.l    SpeakIO,a1
  1747.     move.b    #NT_MESSAGE,LN_TYPE(a1)
  1748.     move.l    d0,MN_REPLYPORT(a1)
  1749.     move.w    #MP_SIZE,MN_LENGTH(a1)
  1750.     lea    NarDev_Name,a0
  1751.     move.l    SpeakIO,a1
  1752.     bsr.s    DeviceOpen
  1753.     move.l    SpeakIO,a1
  1754.     move.l    OutBuf,d0
  1755.     move.l    d0,IO_DATA(a1)
  1756.     move.w    #CMD_WRITE,IO_COMMAND(a1)    ;Set up for output audio $
  1757.     lea    AudChn,a0
  1758.     move.l    a0,NDI_CHMASKS(a1)
  1759.     move.w    #4,NDI_NUMMASKS(a1)
  1760.     move.w    #40,NDI_VOLUME(a1)
  1761. *    move.w    #21000,NDI_SAMPFREQ(a1)
  1762. *    bsr    SetMale
  1763.     move.l    (a7)+,a6
  1764.     rts
  1765. SetMale:
  1766.     move.l    a1,-(a7)
  1767.     move.l    SpeakIO,a1
  1768.     move.w    #MALE,NDI_SEX(a1)
  1769.     move.w    #DEFFREQ,NDI_SAMPFREQ(a1)
  1770.     move.w    #110,NDI_PITCH(a1)
  1771.     move.w    #160,NDI_RATE(a1)
  1772.     move.l    (a7)+,a1
  1773.     rts
  1774. SetFemale:
  1775.     move.l    a1,-(a7)
  1776.     move.l    SpeakIO,a1
  1777. *    move.w    #MAXFREQ,NDI_SAMPFREQ(a1)
  1778.     move.w    #24000,NDI_SAMPFREQ(a1)
  1779.     move.w    #FEMALE,NDI_SEX(a1)
  1780.     move.w    #190,NDI_PITCH(a1)
  1781.     move.w    #170,NDI_RATE(a1)
  1782.     move.l    (a7)+,a1
  1783.     rts
  1784. ConsolePort:
  1785.     move.l    a6,-(a7)
  1786.     move.l    _AbsExecBase,a6
  1787.     move.l    #IOSTD_SIZE,d0
  1788.     bsr    StructureAlloc
  1789.     move.l    d0,ConIO    ;Save pointer to IO request block
  1790.     bsr    PortCreate
  1791.     bsr    TaskFind
  1792.     move.l    MsgPort,a1
  1793.     move.l    a1,MsgPortC
  1794.     move.l    Signal,a1
  1795.     move.l    a1,SignalC
  1796.     lea    ConDev_Name,a0
  1797.     move.l    ConIO,a1
  1798.     move.b    #NT_MESSAGE,LN_TYPE(a1)
  1799.     move.l    d0,MN_REPLYPORT(a1)
  1800.     move.w    #MP_SIZE,MN_LENGTH(a1)
  1801.     move.l    MyWindow,d0
  1802.     move.l    d0,IO_DATA(a1)
  1803.     bsr.s    DeviceOpen
  1804.     move.l    (a7)+,a6
  1805.     rts
  1806. DeviceOpen:
  1807.     move.l    #0,d0
  1808.     move.l    #0,d1
  1809.     jsr    _LVOOpenDevice(a6)
  1810.     rts
  1811. CloseDevices:
  1812.     move.l    a6,-(a7)
  1813.     move.l    _AbsExecBase,a6
  1814.     move.l    SpeakIO,d1
  1815.     move.l    #NDI_SIZE,d0
  1816.     bsr.s    DeviceClose
  1817.     move.l    SignalN,d0
  1818.     move.l    #0,SpeakIO
  1819.     move.l    d0,Signal
  1820.     move.l    MsgPortN,d0
  1821.     move.l    d0,MsgPort
  1822.     bsr    PortDelete
  1823.     move.l    ConIO,d1
  1824.     move.l    #IOSTD_SIZE,d0
  1825.     bsr.s    DeviceClose
  1826.     move.l    #0,ConIO
  1827.     move.l    SignalC,d0
  1828.     move.l    d0,Signal
  1829.     move.l    MsgPortC,d0
  1830.     move.l    d0,MsgPort
  1831.     bsr    PortDelete
  1832.     move.l    (a7)+,a6
  1833.     rts
  1834. DeviceClose:
  1835.     move.l    d1,a1            ;See if 0
  1836.     beq.s    WasCl
  1837.     movem.l    d0/a1,-(a7)        ;Save pointer to IOReqStr
  1838.     jsr    _LVOCloseDevice(a6)
  1839.     movem.l    (a7)+,d0/a1        ;Recover IOReqStr pointer and Size
  1840.     bsr    StructFree
  1841. WasCl:    rts
  1842.  
  1843. Async:
  1844.     movem.l    d0-d7/a1-a6,-(a7)
  1845.     move.l    TranslatorLibrary,a6
  1846.     move.l    a0,a1
  1847.     bsr.s    EndFnd
  1848.     move.l    a1,-(a7)    ;Save beginning of next string
  1849.     move.l    OutBuf,a1
  1850.     move.l    #400,d1        ;Output buffer 200 bytes long
  1851.     jsr    _LVOTranslate(a6)
  1852.     move.l    OutBuf,a1
  1853.     bsr.s    EndFnd
  1854.     move.l    #1,PendIO    ;Indicate IO is active
  1855.     move.l    SpeakIO,a1
  1856.     move.l    _AbsExecBase,a6
  1857.     move.l    d0,IO_LENGTH(a1)
  1858.     jsr    _LVOSendIO(a6)
  1859.     move.l    (a7)+,a0    ;Recover beginning of next string.
  1860.     movem.l    (a7)+,d0-d7/a1-a6
  1861.     rts
  1862. TransIt:
  1863.     movem.l    d0-d7/a1-a6,-(a7)
  1864.     move.l    TranslatorLibrary,a6
  1865.     move.l    a0,a1
  1866.     bsr.s    EndFnd
  1867.     move.l    a1,-(a7)    ;Save beginning of next string
  1868.     move.l    OutBuf,a1
  1869.     move.l    #400,d1        ;Output buffer 200 bytes long
  1870.     jsr    _LVOTranslate(a6)
  1871.     move.l    OutBuf,a1
  1872.     bsr.s    EndFnd
  1873.     move.l    SpeakIO,a1
  1874.     move.l    _AbsExecBase,a6
  1875.     move.l    d0,IO_LENGTH(a1)
  1876.     jsr    _LVODoIO(a6)
  1877.     move.l    (a7)+,a0    ;Recover beginning of next string.
  1878.     movem.l    (a7)+,d0-d7/a1-a6
  1879.     rts
  1880. EndFnd:    move.l    #0,d0
  1881.     move.l    d0,d2
  1882. NxtByt:    move.b    (a1)+,d1    ;Get translated code
  1883.     beq.s    CodDon
  1884.     addq.l    #1,d0
  1885.     cmp.b    #$a,d1
  1886.     beq.s    NxtByt
  1887.     addq.l    #1,d2
  1888.     bra.s    NxtByt
  1889. CodDon:    rts
  1890. KeyRead:
  1891.     movem.l    a1/a6,-(a7)
  1892.     move.l    ConIO,a1
  1893.     move.l    _AbsExecBase,a6
  1894.     move.l    #MyBuffer,IO_DATA(a1)
  1895.     move.l    #1,IO_LENGTH(a1)
  1896.     move.w    #CMD_READ,IO_COMMAND(a1)
  1897.     move.b    #IO_QUICK,IO_FLAGS(a1)
  1898.     jsr    _LVOSendIO(a6)
  1899. *    jsr    _LVODoIO(a6)
  1900.     move.b    MyBuffer,d0
  1901.     move.l    IO_ACTUAL(a1),d1    ;Get #bytes
  1902.     movem.l    (a7)+,a1/a6
  1903.     rts
  1904. CtrBlock:
  1905.     move.l    d3,-(a7)
  1906.     bsr    CtrWrite
  1907.     move.l    (a7)+,d3
  1908.     subq.l    #1,d3
  1909.     bne.s    CtrBlock
  1910.     rts
  1911. TitleTran:
  1912.     lea    NewWindTitle,a0
  1913.     move.l    WTBuf,a1
  1914.     move.l    a1,-(a7)
  1915.     bsr    CntFnd
  1916.     move.l    (a7)+,a1
  1917.     bra.s    SpcFil
  1918. TabWrite:
  1919.     movem.l    a1/a6,-(a7)
  1920.     move.l    d2,d1
  1921.     bra.s    CmpTab
  1922. CntFnd:    move.l    a0,a1
  1923.     bsr    EndFnd
  1924.     move.l    PrefBuf,d1
  1925.     sub.l    d2,d1
  1926.     subq.l    #1,d1
  1927.     asr.l    #1,d1
  1928.     move.l    d1,d2
  1929.     rts
  1930. FilSpc:    move.l    StrBuf,a1
  1931. SpcFil:    move.b    #$20,(a1)+
  1932.     subq.l    #1,d1
  1933.     bne.s    SpcFil
  1934. ChrTrn:    move.b    (a0)+,d0
  1935.     move.b    d0,(a1)+
  1936.     bne.s    ChrTrn
  1937.     rts
  1938. CtrWrite:
  1939.     movem.l    a1/a6,-(a7)
  1940.     bsr.s    CntFnd        ;Find # of leading spaces
  1941. CmpTab:
  1942.     bsr    FilSpc
  1943.     move.l    a0,-(a7)
  1944.     move.l    StrBuf,a0
  1945.     bsr    StrWrite
  1946.     move.l    (a7)+,a0    ;Recover beginning of Next string.
  1947.     movem.l    (a7)+,a1/a6
  1948.     rts
  1949. StrWrite:
  1950.     movem.l    a1/a6,-(a7)
  1951.     move.l    _AbsExecBase,a6
  1952.     move.l    ConIO,a1
  1953.     move.w    #CMD_WRITE,IO_COMMAND(a1)
  1954.     move.l    a0,IO_DATA(a1)        ;a0 points to string
  1955.     move.l    #-1,IO_LENGTH(a1)    ;Write string ending with 0
  1956.     move.l    #0,IO_ACTUAL(a1)    ;Clear counter
  1957. *    jsr    _LVOSendIO(a6)
  1958.     jsr    _LVODoIO(a6)
  1959. WrtChk:    move.l    ConIO,a1
  1960.     move.l    IO_ACTUAL(a1),d1
  1961.     beq.s    WrtChk        ;Don't leave until value non-zero
  1962.     movem.l    (a7)+,a1/a6
  1963.     rts
  1964. OpenNewScreen:
  1965.     move.l    a6,-(a7)
  1966.     move.l    #ns_SIZEOF,d0
  1967.     bsr    StructureAlloc
  1968.     move.l    d0,MyNewScreen
  1969.     bsr    InitTxtAttr    ;Initialize the text attribute structure
  1970.     lea    FontName,a1    ;Get name of font.
  1971.     move.l    DiskFontLibrary,a6
  1972.     move.l    a1,(a0)        ;Store font name pointer in structure.
  1973.     jsr    _LVOOpenDiskFont(a6);Open the font
  1974.     move.l    MyNewScreen,a2    ;Point to new screen structure
  1975.     move.l    d0,ns_Font(a2)    ;Store font designation.
  1976.     move.l    d0,ScrFnt
  1977.     move.w    #640,ns_Width(a2)
  1978.     move.w    #400,ns_Height(a2)
  1979.     move.w    #2,ns_Depth(a2)
  1980.     move.b    #3,ns_DetailPen(a2)    ;Invisible
  1981.     move.b    #0,ns_BlockPen(a2)    ;White
  1982.     move.w    #MyView,ns_ViewModes(a2)
  1983.     move.w    #CUSTOMSCREEN,ns_Type(a2)
  1984.     move.l    MyNewScreen,a0    ;Get pointer the new screen structure
  1985.     movea.l    IntuitionLibrary,a6
  1986.     jsr    _LVOOpenScreen(a6)    ;Get file handle, already open
  1987.     move.l    d0,MyScreenA    ;Pointer to new screen
  1988.     beq.s    ScrnFail
  1989.     move.l    MyNewScreen,a0    ;Get pointer the new screen structure
  1990.     movea.l    IntuitionLibrary,a6
  1991.     jsr    _LVOOpenScreen(a6)    ;Get file handle, already open
  1992.     move.l    d0,MyScreenB    ;Pointer to new screen
  1993.     beq.s    ScrnFail
  1994.     move.l    (a7)+,a6
  1995.     rts
  1996. ScrnFail:
  1997.     lea    ScrFail,a0
  1998.     bsr    TransIt
  1999.     move.l    (a7)+,a6
  2000.     rts
  2001.  
  2002. * Close the Screen
  2003. CloseNewScreen
  2004.     move.l    a6,-(a7)
  2005.     move.l    MyNewScreen,d0    ;Point to new screen structure
  2006.     beq.s    NoScreenStr
  2007.     move.l    d0,a1    
  2008.     move.l    ns_Font(a1),a1    ;Get pointer for textfont
  2009.     move.l    GraphicsLibrary,a6
  2010.     jsr    _LVOCloseFont(a6);Close the font
  2011.     bsr    FreeTxtAttr
  2012. NoScreenStr:
  2013.     movea.l    IntuitionLibrary,a6
  2014.     move.l    MyScreenA,d0
  2015.     beq.s    NoScrA
  2016.     move.l    d0,a0
  2017.     jsr    _LVOCloseScreen(a6)
  2018. NoScrA:    move.l    MyScreenB,d0
  2019.     move.l    d0,a0
  2020.     beq.s    NoScrB
  2021.     jsr    _LVOCloseScreen(a6)
  2022. NoScrB:    move.l    MyNewScreen,d0
  2023.     beq.s    NoNewScr
  2024.     move.l    d0,a1
  2025.     move.l    #ns_SIZEOF,d0
  2026.     bsr    StructFree
  2027. NoNewScr:
  2028.     move.l    #0,MyNewScreen
  2029.     move.l    (a7)+,a6
  2030.     rts
  2031. ColorSet:
  2032.     movem.l    d0-d7/a0-a6,-(a7)
  2033.     move.l    MyScreenA,a3
  2034.     move.l    a3,a0
  2035.     add.l    #sc_ViewPort,a0
  2036.     move.l    CTable,a1
  2037.     move.l    #4,d0
  2038.     jsr    _LVOLoadRGB4(a6)
  2039.     add.l    #sc_BitMap,a3    ;Get up to bitmap structure
  2040.     add.l    #bm_Planes,a3    ;Get pointer to 1st plane.
  2041.     move.l    a3,PnPtr0
  2042.     move.l    MyScreenB,a3
  2043.     move.l    a3,a0
  2044.     add.l    #sc_ViewPort,a0
  2045.     move.l    CTable,a1
  2046.     move.l    #4,d0
  2047.     jsr    _LVOLoadRGB4(a6)
  2048.     add.l    #sc_BitMap,a3    ;Get up to bitmap structure
  2049.     add.l    #bm_Planes,a3    ;Get pointer to 1st plane.
  2050.     move.l    a3,PnPtr1
  2051.     movem.l    (a7)+,d0-d7/a0-a6
  2052.     move.l    GraphicsLibrary,a6
  2053.     rts
  2054. StructFree:
  2055.     move.l    a6,-(a7)
  2056.     move.l    _AbsExecBase,a6
  2057.     move.l    a1,d1
  2058.     beq.s    IsFree
  2059.     jsr    _LVOFreeMem(a6)
  2060. IsFree:    move.l    (a7)+,a6
  2061.     rts
  2062. InitTxtAttr:
  2063.     move.l    #ta_SIZEOF,d0
  2064.     bsr.s    StructureAlloc
  2065.     move.l    d0,MyTextAttr
  2066.     move.l    d0,a0
  2067.     move.w    #20,ta_YSize(a0)
  2068.     rts
  2069. FreeTxtAttr:
  2070.     move.l    MyTextAttr,d0
  2071.     beq.s    NoTA
  2072.     move.l    d0,a1
  2073.     move.l    #ta_SIZEOF,d0
  2074.     bsr.s    StructFree
  2075. NoTA:    move.l    #0,MyTextAttr
  2076.     rts
  2077. OpenNil:
  2078.     move.l    a6,-(a7)
  2079.     move.l    DosLibrary,a6
  2080.     move.l    #NilDev,d1
  2081.     move.l    #MODE_OLDFILE,d2
  2082.     jsr    _LVOOpen(a6)
  2083.     move.l    d0,NilHandle
  2084.     beq.s    NilFail
  2085.     move.l    (a7)+,a6
  2086.     rts
  2087. NilFail:
  2088.     lea    FailNil,a0
  2089.     bsr    TransIt
  2090.     move.l    (a7)+,a6
  2091.     rts
  2092. CloseNil:
  2093.     move.l    a6,-(a7)
  2094.     move.l    DosLibrary,a6
  2095.     move.l    NilHandle,d1
  2096.     beq.s    NilClosed
  2097.     jsr    _LVOClose(a6)
  2098. NilClosed:
  2099.     move.l    (a7)+,a6
  2100.     rts
  2101. Second:
  2102.     move.l    #Command3,d1
  2103.     bra.s    DoIt
  2104. Third:    move.l    #Command4,d1
  2105. DoIt:    move.l    #0,d2
  2106.     move.l    NilHandle,d3
  2107.     move.l    a6,-(a7)
  2108.     move.l    DosLibrary,a6
  2109.     jsr    _LVOExecute(a6)
  2110.     move.l    (a7)+,a6
  2111.     rts
  2112. SDelay:    move.l    #100,d1
  2113.     jsr    _LVODelay(a6)
  2114.     rts
  2115. CopyFiles:
  2116.     movem.l    d0-d7/a0-a6,-(a7)
  2117.     move.l    #CommandA,d1        ;do a MakeDir for RAM:StereoDemo
  2118.     bsr    DoIt
  2119.     tst.l    d0
  2120.     bne.s    SuccessA
  2121.     lea    FailA,a0
  2122.     bsr    TransIt
  2123. SuccessA:
  2124.     move.l    #CommandB,d1
  2125.     bsr    DoIt
  2126.     tst.l    d0
  2127.     bne.s    SuccessB
  2128.     lea    FailA,a0
  2129.     bsr    TransIt
  2130. SuccessB:
  2131.     move.l    DosLibrary,a6
  2132.     move.l    #RamFile,RamFP
  2133.     move.l    #RamName,RamNP
  2134.     move.l    #fib_SIZEOF+6000,d0    ;Get memory for FIB and files to copy
  2135.     bsr    StructureAlloc
  2136.     move.l    d0,FIB
  2137.     add.l    #fib_SIZEOF,d0
  2138.     move.l    d0,FileBuffer
  2139.     move.l    #Stereo,d1        ;Point to name Stereo
  2140.     move.l    #ACCESS_READ,d2
  2141.     jsr    _LVOLock(a6)        ;Get lock
  2142.     tst.l    d0            ;See if null
  2143.     beq.s    NotThere        ;Is on current director
  2144.     move.l    d0,d1            ;Get ready to unlock (not open)
  2145.     jsr    _LVOUnLock(a6)        ;Release it.
  2146.     bra.s    CurDir            ;Current directory if got to here
  2147. NotThere:
  2148.     bsr    CopyPaths
  2149.     bra.s    CopyDone
  2150. CurDir:    move.l    #WndName,d1
  2151.     bsr    CopyOne
  2152.     move.l    #Wnd2Name,d1
  2153.     bsr    CopyOne
  2154. CopyDone:
  2155.     move.l    #Ram2Name,RamNP
  2156.     move.l    #Ram2File,RamFP
  2157.     move.l    #CRun,d1
  2158.     bsr    CopyC
  2159.     move.l    #CAssign,d1
  2160.     bsr    CopyC
  2161.     move.l    #CDelete,d1
  2162.     bsr    CopyC
  2163.     move.l    FIB,a1
  2164.     move.l    #fib_SIZEOF+6000,d0
  2165.     bsr    StructFree
  2166.     move.l    #CommandC,d1
  2167.     bsr    DoIt            ;Assign c: ram:c
  2168.     movem.l    (a7)+,d0-d7/a0-a6
  2169.     rts
  2170. CopyC:    addq.l    #2,d1            ;Get to name without c:
  2171.     move.l    d1,-(a7)
  2172.     subq.l    #2,d1            ;Back to c:name
  2173.     bra.s    DoOpen
  2174. CopyPaths:
  2175.     move.l    #WndName,d1
  2176.     bsr    CopyFull
  2177.     move.l    #Wnd2Name,d1
  2178. CopyFull:
  2179.     move.l    d1,-(a7)        ;Save pointer to short file name
  2180.     move.l    RemPath,a1        ;Get location for rest of string
  2181.     bsr    CopyName        ;Append name to path
  2182.     move.l    #FullPath,d1        ;Set to open full path.
  2183.     bra.s    DoOpen            ;Open and copy the file
  2184. CopyOne:
  2185.     move.l    d1,-(a7)        ;Save pointer to file name
  2186. DoOpen:    move.l    #MODE_OLDFILE,d2
  2187.     jsr    _LVOOpen(a6)
  2188.     move.l    d0,DosFileHandle
  2189.     beq.s    NoFile
  2190.     move.l    DosFileHandle,d1
  2191.     move.l    FileBuffer,d2
  2192.     move.l    #6000,d3
  2193.     jsr    _LVORead(a6)    ;Read file
  2194.     move.l    d0,FileLength
  2195.     move.l    DosFileHandle,d1
  2196.     jsr    _LVOClose(a6)    ;Close it
  2197.     move.l    (a7)+,d1    ;Recover file name
  2198.     move.l    RamNP,a1
  2199.     bsr    CopyName
  2200.     move.l    RamFP,d1
  2201.     move.l    #MODE_NEWFILE,d2
  2202.     jsr    _LVOOpen(a6)
  2203.     move.l    d0,DosFileHandle
  2204.     move.l    d0,d1        ;Filehandle into d1
  2205.     move.l    FileBuffer,d2
  2206.     move.l    FileLength,d3
  2207.     jsr    _LVOWrite(a6)
  2208.     move.l    DosFileHandle,d1
  2209.     jsr    _LVOClose(a6)
  2210.     rts
  2211. NoFile:    move.l    (a7)+,d1
  2212.     bsr    SDelay
  2213.     rts
  2214. CopyName:
  2215.     move.l    d1,a0
  2216. CpyChr:    move.b    (a0)+,d0
  2217.     move.b    d0,(a1)+
  2218.     bne.s    CpyChr
  2219.     rts
  2220. CopyPath:
  2221.     move.l    $c(a5),a0    ;Get pointer to pointer to name
  2222.     move.l    (a0),a0        ;Get pointer to name
  2223.     lea    FullPath,a1
  2224. MovChr:    move.b    (a0)+,d0
  2225.     move.b    d0,(a1)+
  2226.     bne.s    MovChr
  2227. FstLet:    move.b    -(a1),d0    ;Get last byte
  2228.     bclr    #5,d0        ;Mask off lower-case bit
  2229.     cmp.b    #'S',d0        ;See if 1st letter of Stereo
  2230.     bne.s    FstLet
  2231.     move.l    a1,RemPath    ;Point to remainder of filename path
  2232.     rts
  2233.  
  2234.     dseg
  2235.  
  2236. RamFP:    ds.l    1    ;Pointer to ram file
  2237. RamNP:    ds.l    1    ;Pointer to name for ram file
  2238. CurAmy:    dc.l    0    ;Current location in AmyTab
  2239. AmyTab:    dc.l    AmyOne,AmyTwo,AmyThree,AmyFour,0
  2240. TabAmy:    dc.l    AmySix,AmySeven,AmyEight,0
  2241. DaveTab:
  2242.     dc.l    DaveOne,DaveTwo,0
  2243. LateAmy:
  2244.     dc.l    Amy1,DaveThree,DaveFour,NxtFive,NxtSix,NxtSev,NxtEgt,NxtNin
  2245.     dc.l    NxtTen,NxtElv,NxtTwl,NxtThr,NxtFrt,NxtFif,NxtSxt,NxtSvt
  2246.     dc.l    NxtEtt,NxtNnt,NxtTwt,NxtTt1,NxtTt2,NxtTt3,0
  2247. LstTab:    dc.l    Warning,Wrn2,NxtNul,NxtNul,NxtNul,NxtNul,NxtNul,NxtNul,NxtNul,NxtNul,NxtNul,NxtNul,Lst1,Lst2
  2248.     dc.l    NxtNul,NxtNul,NxtNul,NxtNul,NxtNul,NxtNul
  2249.     dc.l    Lst3,Lst4,Lst5,Lst6,Lst7,Lst8,Lst9,NxtNul,NxtNul,NxtNul,NxtNul,NxtNul,Lst10,Lst11,Lst12,0
  2250. PendIO:    dc.l    0
  2251. RemPath:
  2252.     dc.l    0
  2253. FileLength:
  2254.     dc.l    0
  2255. DosFileHandle:
  2256.     dc.l    0
  2257. FileBuffer:
  2258.     dc.l    0    ;Pointer to buffer for file copying.
  2259. Error:    dc.l    0
  2260. MyName:    dc.l    0
  2261. FIB:    dc.l    0
  2262. CurrentLock:
  2263.     dc.l    0
  2264. OldLock:
  2265.     dc.l    0
  2266. WBMsg:    dc.l    0
  2267. NilHandle:
  2268.     dc.l    0
  2269. PrefBuf:
  2270.     dc.l    0
  2271. MyTextAttr:
  2272.     dc.l    0
  2273. StrBuf:    dc.l    0
  2274. WTBuf:    dc.l    0
  2275. MyNewScreen:
  2276.     dc.l    0
  2277. MyScreenA:
  2278.     dc.l    0
  2279. MyScreenB:
  2280.     dc.l    0
  2281. ScrFnt:    dc.l    0
  2282. MyBuffer:
  2283.     dc.l    0,0    ;Keyboard input buffer
  2284. OutBuf:    dc.l    0    ;Output buffer for narrator.
  2285. SndBuf:    dc.l    0    ;Audio buffer
  2286. MsgPort:
  2287.     dc.l    0
  2288. MsgPortN:
  2289.     dc.l    0    ;Message port for narrator
  2290. MsgPortC:
  2291.     dc.l    0    ;Message port for console
  2292. Signal:    dc.l    0
  2293. SignalN:
  2294.     dc.l    0    ;Pointer for Narrator Signal
  2295. SignalC:
  2296.     dc.l    0    ;Pointer of Console Signal
  2297. ConIO:
  2298.     dc.l    0    ;Pointer for structure for console io
  2299. SpeakIO:        ;Pointer for structure for narrator io
  2300.     dc.l    0
  2301.  
  2302. TranslatorLibrary:
  2303.     dc.l    0
  2304. DiskFontLibrary:
  2305.     dc.l    0
  2306. AudChn:    dc.b    3,5,10,12
  2307. DZ:    dc.l    1
  2308. *SpriteSave:
  2309. *    ds.l    1
  2310. *SpriteBuffer:
  2311. *    dc.l    0
  2312. FirstY:    ds.l    1
  2313. FirstX:    ds.l    1
  2314. CTable:    dc.l    CTable2
  2315. Savea5:    ds.l    1
  2316. Savea6:    ds.l    1
  2317. InitSP:    ds.l    1
  2318. ErrNum:    dc.l    0
  2319. SinTab:    ds.l    1
  2320. CosTab:    ds.l    1
  2321. ThetaTotal:
  2322.     ds.l    1
  2323. ThetaNew:
  2324.     ds.l    1
  2325. TopOffset:
  2326.     ds.l    1
  2327. BottomOffset:
  2328.     ds.w    1
  2329. LastTop:
  2330.     dc.w    0
  2331. MouCnt:    ds.w    1
  2332. LastMouse:
  2333.     ds.l    1
  2334. DTheta:    dc.l    128
  2335. xoffset:
  2336.     ds.l    1
  2337. yoffset:
  2338.     ds.l    1
  2339. zoffset:
  2340.     ds.l    1
  2341. z:    ds.l    1
  2342.  
  2343. rho:    ds.l    1
  2344. xtemp:    ds.l    1
  2345. ytemp:    ds.l    1
  2346. SegLength:
  2347.     ds.w    1
  2348. Leaf:    ds.w    1
  2349. octcod:
  2350.     dc.w    OCTANT1,OCTANT4,OCTANT5,OCTANT8,OCTANT2,OCTANT3,OCTANT6,OCTANT7
  2351. PagNum:    ds.l    1
  2352. Theta:    dc.l    1
  2353. Phi:    dc.l    1
  2354. DPhi:    dc.l    0
  2355. SinTheta:
  2356.     dc.w    1
  2357. CosTheta:
  2358.     dc.w    1
  2359. SinPhi:    dc.w    1
  2360. CosPhi:    dc.w    1
  2361.  
  2362.  
  2363. IntuitionLibrary:    ;Library pointers will be null until opened.
  2364.     dc.l    0
  2365. GraphicsLibrary:
  2366.     dc.l    0
  2367. DosLibrary:
  2368.     dc.l    0
  2369. MyNewWindow:
  2370.     ds.l    1
  2371. MyWindow:
  2372.     ds.l    1
  2373. bytwidth:
  2374.     ds.l    1
  2375. PortView:
  2376.     ds.l    1
  2377. * The 4 elements of the following color table are practically perfect
  2378. *  for the 3D filters I'm using.
  2379.  
  2380. CTable2:
  2381.     dc.w    $550,$d40,$490,$d90    ;green was $0a0
  2382.  
  2383. MCTable:
  2384.     dc.w    $fff,0,0,$f0
  2385. SColor:    ds.w    4
  2386. PnPtr0:    dc.l    0        ;,0,0,0,0,0,0,0    ;Pointer for 8 bit planes.
  2387.  
  2388. PnPtr1:    dc.l    0        ;,0,0,0,0,0,0,0    ;Pointer for 8 bit planes.
  2389.  
  2390. sintab:    dc.w    0,$11E,$23C,$359,$477,$594,$6B1,$7CD
  2391.     dc.w    $8E9,$A03,$B1D,$C36,$D4E,$E66,$F7C,$1090
  2392.     dc.w    $11A4,$12B6,$13C7,$14D6,$15E4,$16F0,$17FA,$1902
  2393.     dc.w    $1A08,$1B0C,$1C0E,$1D0E,$1E0C,$1F07,$2000,$20F6
  2394.     dc.w    $21EA,$22DB,$23CA,$24B5,$259E,$2684,$2767,$2847
  2395.     dc.w    $2923,$29FD,$2AD3,$2BA6,$2C75,$2D41,$2E0A,$2ECE
  2396.     dc.w    $2F90,$304D,$3107,$31BD,$326F,$331D,$33C7,$346D
  2397.     dc.w    $350F,$35AD,$3646,$36DC,$376D,$37FA,$3882,$3906
  2398.     dc.w    $3986,$3A01,$3A78,$3AEA,$3B57,$3BC0,$3C24,$3C83
  2399.     dc.w    $3CDE,$3D34,$3D85,$3DD2,$3E19,$3E5C,$3E9A,$3ED3
  2400.     dc.w    $3F07,$3F36,$3F61,$3F86,$3FA6,$3FC2,$3FD8,$3FEA
  2401.     dc.w    $3FF6,$3FFE
  2402. costab:    dc.w    $3FFF,$3FFE,$3FF6,$3FEA
  2403. LeftEye:
  2404.     ds.l    1
  2405. RightEye:
  2406.     ds.l    1
  2407. PointCount:
  2408.     ds.w    1
  2409. FrmCnt:    ds.w    1
  2410. LoopCnt:
  2411.     dc.w    0
  2412. AName:    dc.w    -241,50,-194,-50,-187,-50,-153,50,-162,50,-174,14
  2413.     dc.w    -214,14,-231,50,-241,50
  2414.     dc.w    -210,6,-191,-36,-178,6,-210,6
  2415.  
  2416. MName:    dc.w    -132,50,-106,-50,-97,-50,-88,-17,-68,-50,-61,-50,-54,50
  2417.     dc.w    -62,50,-68,-33,-87,-4,-93,-4,-102,-31,-125,50,-132,50
  2418.  
  2419. IName:    dc.w    -20,50,-20,41,-12,41,0,-41,-9,-41,-9,-50,20,-50
  2420.     dc.w    20,-41,9,-41,-3,41,5,41,5,50,-20,50
  2421.  
  2422. GName:
  2423.     dc.w    51,50,67,-50,128,-50,124,-25,113,-25,116,-41,77,-41
  2424.     dc.w    64,41,100,41,103,25,87,25,87,18,127,18,127,25
  2425.     dc.w    114,25,109,50,51,50
  2426. AName2:    dc.w    149,50,196,-50,203,-50,237,50,228,50,216,14
  2427.     dc.w    176,14,159,50,149,50
  2428.     dc.w    180,6,199,-36,212,6,180,6
  2429. TXTURE:    ds.w    1
  2430. DosName:
  2431.     dc.b    'dos.library',0
  2432. DiskFontName:
  2433.     dc.b    'diskfont.library',0
  2434. IntuitionName:
  2435.     dc.b    'intuition.library',0
  2436. GraphicsName:
  2437.     dc.b    'graphics.library',0
  2438. FontName:
  2439.     dc.b    'diamond.font',0
  2440. DubFed:    dc.b    $a,$a,0
  2441. LinFed:    dc.b    $a,0
  2442. SprSts:    dc.b    0
  2443. IntMes0:
  2444.     dc.b    'Animated 3D Graphics',$a,$a,0
  2445.     dc.b    'Software',$a,$a,0
  2446.     dc.b    'by',$a,$a,0
  2447.     dc.b    'David M. McKinstry',$a,$a,0
  2448. IntMes1:
  2449.     dc.b    'Copyright ',$a9,' 1987-88',$a,$a,0
  2450. IntMes2:
  2451.     dc.b    'View on RGB analog monitor using "3D Glasses",',$a,0
  2452.     dc.b    'Red for left eye and Green for right!',$a,$a,0
  2453. AnCmd:    dc.b    'Return to Intuition          I',$a,$a,0
  2454.     dc.b    'Terminate Program            Control C',$a,$a,0
  2455. NewWindTitle:
  2456.     dc.b    'Stereoscopic Demonstration',0
  2457. NarDev_Name:
  2458.     dc.b    'narrator.device',0
  2459. ConDev_Name:
  2460.     dc.b    'console.device',0
  2461. AudDev_Name:
  2462.     dc.b    'audio.device',0
  2463. TranslatorName:
  2464.     dc.b    'translator.library',0
  2465. WhiteScript:
  2466.     dc.b    $9b,'40;31m',0
  2467. OrangeScript:
  2468.     dc.b    $9b,'40;33m',0
  2469. Remem:    dc.b    'If you want to run anuhther program that requires uce of the floppy drives, '
  2470.     dc.b    'press I to stop the animation and get back to in2ihshun!',0
  2471. Caution:
  2472.     dc.b    'The prowgram can only be terminated by uzing control see, '
  2473.     dc.b    'while the animation is proceeding!',0
  2474. DefStr:    dc.b    'The default for this demo is 1 pass through.',0
  2475.     dc.b    'If you want the animation to run forever, press the space bar'
  2476.     dc.b    'within the next 4 seconds!',0
  2477. SpcStr:    dc.b    'Press the space bar for continuous looping!',0
  2478. HomeIt:    dc.b    12,$a,$a,9,9
  2479. MyString:
  2480.     dc.b    'Press the space bar to continue!',0
  2481. MenStr:    dc.b    'This demonstration may be freely dooplicated and used by anyone, '
  2482.     dc.b    'as long is it is kept at a unit and includes the above copyright notice.',0
  2483.     dc.b    'In addition, the drower StereoDemo and all its files must be kawpeed without '
  2484.     dc.b    'changing them in order for the demo to run correctly.',0
  2485. Mes1:    dc.b    'Befowr we start this demo, place the 3 D glasses with the red filter'
  2486.     dc.b    'in front of yowr left I and green filter in front of yowr right I.',0
  2487.     dc.b    'You should be able to look through each filter and see a single image.',0
  2488.     dc.b    'You may have to adjust the intensity of the monitor to get the '
  2489.     dc.b    'best results.',0
  2490.     dc.b    'Do not sit too clowsleee to the monitor or you may have trouble fusing the 2 images.',0
  2491.     dc.b    'This becomes more critikal if the size of the screen is bigger.',0
  2492. Mes2:    dc.b    'Only the Amiga has the grafix rehzilushun, cullour, and speed '
  2493.     dc.b    'that permits real-time stereoscopic animation.',0
  2494. Mes3:    dc.b    'Amee!',0
  2495.     dc.b    'Please dew not be so critikal',0
  2496.     dc.b    'After all, you can not chew gum either.',0
  2497.     dc.b    'But you dew have sound and graphics ko-prawcessors, 4 thousand '
  2498.     dc.b    '9T6 cuhlurs, and as with this demo, a 6 hundred forty by 4 hundred display.',0
  2499.     dc.b    'Of course, this is standard on every computer in the Commodore Amiga line.',0
  2500.     dc.b    'B4 you interrupted me, I was about to say that the uhbility '
  2501.     dc.b    'of the Amiga for real-time animation makes it an ideal educational tewl.',0
  2502.     dc.b    'Any figure can be rowtated about 3 ahxeez and moved any distance from the viewer.',0
  2503. *Mes8:    dc.b    'How about a flying rowz-eht?',0
  2504. *Mes9:    dc.b    'and a shuttle kraft?',0
  2505. TitleL:    dc.b    'Stereoscopic     Screen',0
  2506. TitleR:    dc.b    '  Stereoscopic  Screen',0
  2507. NilDev:    dc.b    'NIL:',0
  2508. Null:    dc.b    0
  2509. StereoName:
  2510.     dc.b    'StereoFiles',0
  2511. FailNil:
  2512.     dc.b    'Sorry, the NIL device could not be opened',0
  2513. ScrFail:
  2514.     dc.b    'Sorry, Custom Screen could not be opened',0
  2515. CommandA:
  2516.     dc.b    'MakeDir RAM:StereoDemo',0
  2517. CommandB:
  2518.     dc.b    'MakeDir RAM:c',0
  2519. CommandC:
  2520.     dc.b    'Assign c: ram:c',0
  2521. CommandD:
  2522.     dc.b    'Assign c: sys:c',0
  2523. CommandE:
  2524.     dc.b    'Delete RAM:c all',0
  2525. Command3:
  2526.     dc.b    'Run > NIL: RAM:StereoDemo/Window',0
  2527. Command4:
  2528.     dc.b    'Run > NIL: RAM:StereoDemo/Window2',0
  2529. EndCmd:    dc.b    'Delete RAM:StereoDemo all',0
  2530. NoLock:    dc.b    'No lock available',0
  2531. FailA:    dc.b    'Could not MakeDir',0
  2532. FailB:    dc.b    'Could not change directory',0
  2533. FailC:    dc.b    'Could not copy files',0
  2534. AmyOne:    dc.b    'Hello, I am an Amiga personal computer.',0
  2535. AmyTwo: dc.b    'Amigaz  R the only personal computers with the speed, colour, and detail'
  2536.     dc.b    'That permits real-time stereoscopic animation.',0
  2537. AmyThree:
  2538.     dc.b    'I am sorry that my animation is sow slow when I am talking,',0
  2539. AmyFour:
  2540.     dc.b    'but the other personal computers can not even draw and chew gum at the same time.',0
  2541. AmySix:    dc.b    'Yooo Big Dummeee!',0
  2542. AmySeven:
  2543.     dc.b    'I was not talking about their gum chewing!',0
  2544. AmyEight:
  2545.     dc.b    'They can not dew multi-tasking and animation!',0
  2546. DaveOne:
  2547.     dc.b    'Well yes, hardly any other personal computer can do animation, let alone multi-tasking!',0
  2548. DaveTwo:
  2549.     dc.b    'and Amiga has had a completely working multi-tasking operating system for about 3 years!',0
  2550. Amy1:    ;Now it's Amy again
  2551.     dc.b    'Lets pull down our custom screen and see whats going on behind it!',0
  2552. DaveThree:
  2553.     dc.b    'OK!',0
  2554. DaveFour:
  2555.     dc.b    'Whats this?',0
  2556. NxtFive:
  2557.     dc.b    'Well,',0
  2558. NxtSix:    dc.b    ' On our right is a computer from big blue',0
  2559. NxtSev:    dc.b    'and on our left is the computer for  - Quote - the rest of us - UnQuote',0
  2560. NxtEgt:    dc.b    'Oh?',0
  2561. NxtNin:    dc.b    'And just who are the rest of us?',0
  2562. NxtTen:    dc.b    ' ',0
  2563. NxtElv:    dc.b    'They are the extremely ritch!',0
  2564. NxtTwl:    dc.b    'Those are not very good simulations Amy!',0
  2565. NxtThr:    dc.b    'They are soooooow slowoooooo!',0
  2566. NxtFrt:    dc.b    'You are cheating with a lot of delay loops!',0
  2567. NxtFif:    dc.b    'Arnt you?',0
  2568. NxtSxt:    dc.b    'Well!',0
  2569. NxtSvt:    dc.b    'Those computers seem that slow to me!',0
  2570. NxtEtt:    dc.b    'and I have nothing more to say!',0
  2571. NxtNnt:    dc.b    'Well its about time you were quiet!',0
  2572. NxtTwt:    dc.b    'Now let me fihnish what I wanted to say!',0
  2573. NxtTt1:    dc.b    'Those karakteristics already mentioned, along with the Amigaz sound genaerating uhbilities '
  2574.     dc.b    'make it ideal for uce in science education.',0
  2575. NxtTt2:    dc.b    'Some obvious applications for stereoscopic grafix include '
  2576.     dc.b    'vectors and vector fieldzs in fizzix and mathematics,',0
  2577. NxtTt3:
  2578.     dc.b    'and krisolograffee and mowlekular models in fizzix, khemistree, and the life and earth sciences.',0
  2579. NxtNul:    dc.b    '                                                     '
  2580.     dc.b    '                                                 ',0
  2581. WndName:
  2582.     dc.b    'Window',0
  2583. Wnd2Name:
  2584.     dc.b    'Window2',0
  2585. FileOpen:
  2586.     dc.b    'File has been opened',0
  2587. FileRead:
  2588.     dc.b    'File has been read',0
  2589. FileCopy:
  2590.     dc.b    'File has been copied',0
  2591. Warning:
  2592.     dc.b    'Red alert!                           Red alert!',0
  2593. Wrn2:    dc.b    'Alien invader sighted!                             ',0
  2594. Lst1:    dc.b    'You can just Relax Amy.',0
  2595. Lst2:    dc.b    'Its just a friendly flying rowz-eht?',0
  2596. Lst3:    dc.b    'You know, we really should forgive Amy for her outbursts!',0
  2597. Lst4:    dc.b    'After all, she is extremely talented and does not believe she is being'
  2598.     dc.b    'prawperly rehkognized!',0
  2599. Lst5:    dc.b    'But, she is only about 3 years old and has not learned much tolerance '
  2600.     dc.b    'or dihplo-muhsee yet!',0
  2601. Lst6:    dc.b    'Before we leave, I would like to point out that the '
  2602.     dc.b    'power is in the Amiga and AmigaDOS.',0
  2603. Lst7:    dc.b    'All the kahlkulations and display for this demo are done in real time.',0
  2604. Lst8:    dc.b    'The total number of bytes in this demo is about twenty-one thousand.',0
  2605. Lst9:    dc.b    'That means that a single floppy could hold over forty programs like this 1!',0
  2606. Lst10:    dc.b    'Well!',0
  2607. Lst11:    dc.b    'Good bye friendly row-seht',0
  2608. Lst12:    dc.b    'and good bye everyone!',0
  2609.  
  2610. CRun:    dc.b    'C:Run',0
  2611. CAssign:
  2612.     dc.b    'C:Assign',0
  2613. CDelete:
  2614.     dc.b    'C:Delete',0
  2615. Stereo:    dc.b    'Stereo',0
  2616. RamFile:
  2617.     dc.b    'RAM:StereoDemo/'
  2618. RamName:
  2619.     ds.b    80
  2620. FullPath:
  2621.     ds.b    256
  2622. Ram2File:
  2623.     dc.b    'Ram:c/'
  2624. Ram2Name:
  2625.     ds.b    80
  2626.     END
  2627.